home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 June: Reference Library / Dev.CD Jun 96 RL / Dev.CD Jun 96 RL.toast / Technical Documentation / develop / develop Issue 12 / develop Issue 12 code / Apple Events and Objects.sea / Apple Events and Objects / TESample.cp < prev    next >
MacBinary  |  1992-10-16  |  20.3 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
1% dexvert MS-DOS Code Page Info (other/dosCodePage) ext Unsupported
1% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Fri Oct 16 18:27:42 1992, modified Fri Oct 16 18:27:42 1992, creator 'MPS ', type ASCII, 19714 bytes "TESample.cp" , at 0x4d82 744 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% dearkID deark: macbinary default
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0b 54 45 53 61 6d 70 | 6c 65 2e 63 70 00 00 00 |..TESamp|le.cp...|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 4d 02 00 | 00 02 e8 a7 04 f2 5e a7 |.....M..|......^.|
|00000060| 04 f2 5e 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..^.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 c3 d0 00 00 |........|........|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 0d 09 50 |--------|----...P|
|000000e0| 72 6f 67 72 61 6d 3a 09 | 43 50 6c 75 73 54 45 53 |rogram:.|CPlusTES|
|000000f0| 61 6d 70 6c 65 20 32 2e | 30 41 45 0d 09 46 69 6c |ample 2.|0AE..Fil|
|00000100| 65 3a 09 09 54 45 53 61 | 6d 70 6c 65 2e 63 70 0d |e:..TESa|mple.cp.|
|00000110| 20 20 20 20 55 73 65 73 | 3a 20 20 20 20 20 20 20 | Uses|: |
|00000120| 54 45 44 6f 63 75 6d 65 | 6e 74 2e 68 0d 20 20 20 |TEDocume|nt.h. |
|00000130| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 54 45 53 | | TES|
|00000140| 61 6d 70 6c 65 2e 68 0d | 0d 09 62 79 20 41 6e 64 |ample.h.|..by And|
|00000150| 72 65 77 20 53 68 65 62 | 61 6e 6f 77 0d 09 6f 66 |rew Sheb|anow..of|
|00000160| 20 41 70 70 6c 65 20 4d | 61 63 69 6e 74 6f 73 68 | Apple M|acintosh|
|00000170| 20 44 65 76 65 6c 6f 70 | 65 72 20 54 65 63 68 6e | Develop|er Techn|
|00000180| 69 63 61 6c 20 53 75 70 | 70 6f 72 74 0d 09 77 69 |ical Sup|port..wi|
|00000190| 74 68 20 6d 6f 64 69 66 | 69 63 61 74 69 6f 6e 73 |th modif|ications|
|000001a0| 20 62 79 20 45 72 69 63 | 20 42 65 72 64 61 68 6c | by Eric| Berdahl|
|000001b0| 0d 0d 09 43 6f 70 79 72 | 69 67 68 74 20 a9 20 31 |...Copyr|ight . 1|
|000001c0| 39 38 39 2d 31 39 39 30 | 20 41 70 70 6c 65 20 43 |989-1990| Apple C|
|000001d0| 6f 6d 70 75 74 65 72 2c | 20 49 6e 63 2e 0d 09 43 |omputer,| Inc...C|
|000001e0| 6f 70 79 72 69 67 68 74 | 20 a9 20 31 39 39 32 20 |opyright| . 1992 |
|000001f0| 45 72 69 63 20 42 65 72 | 64 61 68 6c 0d 09 41 6c |Eric Ber|dahl..Al|
|00000200| 6c 20 72 69 67 68 74 73 | 20 72 65 73 65 72 76 65 |l rights| reserve|
|00000210| 64 2e 0d 0d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |d...----|--------|
|00000220| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000230| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000240| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000250| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000260| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2a 2f |--------|------*/|
|00000270| 0d 0d 23 69 66 6e 64 65 | 66 20 5f 5f 54 59 50 45 |..#ifnde|f __TYPE|
|00000280| 53 5f 5f 0d 23 69 6e 63 | 6c 75 64 65 20 3c 54 79 |S__.#inc|lude <Ty|
|00000290| 70 65 73 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 23 69 |pes.h>.#|endif.#i|
|000002a0| 66 6e 64 65 66 20 5f 5f | 51 55 49 43 4b 44 52 41 |fndef __|QUICKDRA|
|000002b0| 57 5f 5f 0d 23 69 6e 63 | 6c 75 64 65 20 3c 51 75 |W__.#inc|lude <Qu|
|000002c0| 69 63 6b 44 72 61 77 2e | 68 3e 0d 23 65 6e 64 69 |ickDraw.|h>.#endi|
|000002d0| 66 0d 23 69 66 6e 64 65 | 66 20 5f 5f 46 4f 4e 54 |f.#ifnde|f __FONT|
|000002e0| 53 5f 5f 0d 23 69 6e 63 | 6c 75 64 65 20 3c 46 6f |S__.#inc|lude <Fo|
|000002f0| 6e 74 73 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 23 69 |nts.h>.#|endif.#i|
|00000300| 66 6e 64 65 66 20 5f 5f | 45 56 45 4e 54 53 5f 5f |fndef __|EVENTS__|
|00000310| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 45 76 65 6e 74 |.#includ|e <Event|
|00000320| 73 2e 68 3e 0d 23 65 6e | 64 69 66 0d 23 69 66 6e |s.h>.#en|dif.#ifn|
|00000330| 64 65 66 20 5f 5f 43 4f | 4e 54 52 4f 4c 53 5f 5f |def __CO|NTROLS__|
|00000340| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 43 6f 6e 74 72 |.#includ|e <Contr|
|00000350| 6f 6c 73 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 23 69 |ols.h>.#|endif.#i|
|00000360| 66 6e 64 65 66 20 5f 5f | 57 49 4e 44 4f 57 53 5f |fndef __|WINDOWS_|
|00000370| 5f 0d 23 69 6e 63 6c 75 | 64 65 20 3c 57 69 6e 64 |_.#inclu|de <Wind|
|00000380| 6f 77 73 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 23 69 |ows.h>.#|endif.#i|
|00000390| 66 6e 64 65 66 20 5f 5f | 4d 45 4e 55 53 5f 5f 0d |fndef __|MENUS__.|
|000003a0| 23 69 6e 63 6c 75 64 65 | 20 3c 4d 65 6e 75 73 2e |#include| <Menus.|
|000003b0| 68 3e 0d 23 65 6e 64 69 | 66 0d 23 69 66 6e 64 65 |h>.#endi|f.#ifnde|
|000003c0| 66 20 5f 5f 54 45 58 54 | 45 44 49 54 5f 5f 0d 23 |f __TEXT|EDIT__.#|
|000003d0| 69 6e 63 6c 75 64 65 20 | 3c 54 65 78 74 45 64 69 |include |<TextEdi|
|000003e0| 74 2e 68 3e 0d 23 65 6e | 64 69 66 0d 23 69 66 6e |t.h>.#en|dif.#ifn|
|000003f0| 64 65 66 20 5f 5f 44 49 | 41 4c 4f 47 53 5f 5f 0d |def __DI|ALOGS__.|
|00000400| 23 69 6e 63 6c 75 64 65 | 20 3c 44 69 61 6c 6f 67 |#include| <Dialog|
|00000410| 73 2e 68 3e 0d 23 65 6e | 64 69 66 0d 23 69 66 6e |s.h>.#en|dif.#ifn|
|00000420| 64 65 66 20 5f 5f 44 45 | 53 4b 5f 5f 0d 23 69 6e |def __DE|SK__.#in|
|00000430| 63 6c 75 64 65 20 3c 44 | 65 73 6b 2e 68 3e 0d 23 |clude <D|esk.h>.#|
|00000440| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 5f 5f |endif.#i|fndef __|
|00000450| 53 43 52 41 50 5f 5f 0d | 23 69 6e 63 6c 75 64 65 |SCRAP__.|#include|
|00000460| 20 3c 53 63 72 61 70 2e | 68 3e 0d 23 65 6e 64 69 | <Scrap.|h>.#endi|
|00000470| 66 0d 23 69 66 6e 64 65 | 66 20 5f 5f 54 4f 4f 4c |f.#ifnde|f __TOOL|
|00000480| 55 54 49 4c 53 5f 5f 0d | 23 69 6e 63 6c 75 64 65 |UTILS__.|#include|
|00000490| 20 3c 54 6f 6f 6c 55 74 | 69 6c 73 2e 68 3e 0d 23 | <ToolUt|ils.h>.#|
|000004a0| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 5f 5f |endif.#i|fndef __|
|000004b0| 4d 45 4d 4f 52 59 5f 5f | 0d 23 69 6e 63 6c 75 64 |MEMORY__|.#includ|
|000004c0| 65 20 3c 4d 65 6d 6f 72 | 79 2e 68 3e 0d 23 65 6e |e <Memor|y.h>.#en|
|000004d0| 64 69 66 0d 23 69 66 6e | 64 65 66 20 5f 5f 53 45 |dif.#ifn|def __SE|
|000004e0| 47 4c 4f 41 44 5f 5f 0d | 23 69 6e 63 6c 75 64 65 |GLOAD__.|#include|
|000004f0| 20 3c 53 65 67 4c 6f 61 | 64 2e 68 3e 0d 23 65 6e | <SegLoa|d.h>.#en|
|00000500| 64 69 66 0d 23 69 66 6e | 64 65 66 20 5f 5f 46 49 |dif.#ifn|def __FI|
|00000510| 4c 45 53 5f 5f 0d 23 69 | 6e 63 6c 75 64 65 20 3c |LES__.#i|nclude <|
|00000520| 46 69 6c 65 73 2e 68 3e | 0d 23 65 6e 64 69 66 0d |Files.h>|.#endif.|
|00000530| 23 69 66 6e 64 65 66 20 | 5f 5f 4f 53 55 54 49 4c |#ifndef |__OSUTIL|
|00000540| 53 5f 5f 0d 23 69 6e 63 | 6c 75 64 65 20 3c 4f 53 |S__.#inc|lude <OS|
|00000550| 55 74 69 6c 73 2e 68 3e | 0d 23 65 6e 64 69 66 0d |Utils.h>|.#endif.|
|00000560| 23 69 66 6e 64 65 66 20 | 5f 5f 54 52 41 50 53 5f |#ifndef |__TRAPS_|
|00000570| 5f 0d 23 69 6e 63 6c 75 | 64 65 20 3c 54 72 61 70 |_.#inclu|de <Trap|
|00000580| 73 2e 68 3e 0d 23 65 6e | 64 69 66 0d 23 69 66 6e |s.h>.#en|dif.#ifn|
|00000590| 64 65 66 20 5f 5f 50 41 | 43 4b 41 47 45 53 5f 5f |def __PA|CKAGES__|
|000005a0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 50 61 63 6b 61 |.#includ|e <Packa|
|000005b0| 67 65 73 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 23 69 |ges.h>.#|endif.#i|
|000005c0| 66 6e 64 65 66 20 5f 5f | 45 52 52 4f 52 53 5f 5f |fndef __|ERRORS__|
|000005d0| 0d 23 69 6e 63 6c 75 64 | 65 20 3c 45 72 72 6f 72 |.#includ|e <Error|
|000005e0| 73 2e 68 3e 0d 23 65 6e | 64 69 66 0d 0d 2f 2f 20 |s.h>.#en|dif..// |
|000005f0| 6f 75 72 20 63 6c 61 73 | 73 20 64 65 66 69 6e 69 |our clas|s defini|
|00000600| 74 69 6f 6e 73 0d 23 69 | 66 6e 64 65 66 20 5f 5f |tions.#i|fndef __|
|00000610| 41 45 4f 42 4a 45 43 54 | 53 5f 5f 0d 23 69 6e 63 |AEOBJECT|S__.#inc|
|00000620| 6c 75 64 65 20 22 41 45 | 4f 62 6a 65 63 74 73 2e |lude "AE|Objects.|
|00000630| 68 22 0d 23 65 6e 64 69 | 66 0d 23 69 66 6e 64 65 |h".#endi|f.#ifnde|
|00000640| 66 20 5f 5f 41 45 52 45 | 47 49 53 54 52 59 5f 5f |f __AERE|GISTRY__|
|00000650| 0d 23 69 6e 63 6c 75 64 | 65 20 22 41 45 52 65 67 |.#includ|e "AEReg|
|00000660| 69 73 74 72 79 2e 68 22 | 0d 23 65 6e 64 69 66 0d |istry.h"|.#endif.|
|00000670| 23 69 66 6e 64 65 66 20 | 5f 5f 54 45 44 4f 43 55 |#ifndef |__TEDOCU|
|00000680| 4d 45 4e 54 5f 5f 0d 23 | 69 6e 63 6c 75 64 65 20 |MENT__.#|include |
|00000690| 22 54 45 44 6f 63 75 6d | 65 6e 74 2e 68 22 0d 23 |"TEDocum|ent.h".#|
|000006a0| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 5f 5f |endif.#i|fndef __|
|000006b0| 54 45 53 41 4d 50 4c 45 | 5f 5f 0d 23 69 6e 63 6c |TESAMPLE|__.#incl|
|000006c0| 75 64 65 20 22 54 45 53 | 61 6d 70 6c 65 2e 68 22 |ude "TES|ample.h"|
|000006d0| 0d 23 65 6e 64 69 66 0d | 0d 2f 2f 20 45 78 74 72 |.#endif.|.// Extr|
|000006e0| 65 6d 65 4e 65 67 20 61 | 6e 64 20 45 78 74 72 65 |emeNeg a|nd Extre|
|000006f0| 6d 65 50 6f 73 20 61 72 | 65 20 75 73 65 64 20 74 |mePos ar|e used t|
|00000700| 6f 20 73 65 74 20 75 70 | 20 77 69 64 65 20 6f 70 |o set up| wide op|
|00000710| 65 6e 20 72 65 63 74 61 | 6e 67 6c 65 73 20 61 6e |en recta|ngles an|
|00000720| 64 20 72 65 67 69 6f 6e | 73 2e 0d 63 6f 6e 73 74 |d region|s..const|
|00000730| 20 73 68 6f 72 74 20 6b | 45 78 74 72 65 6d 65 4e | short k|ExtremeN|
|00000740| 65 67 20 3d 20 2d 33 32 | 37 36 38 3b 0d 63 6f 6e |eg = -32|768;.con|
|00000750| 73 74 20 73 68 6f 72 74 | 20 6b 45 78 74 72 65 6d |st short| kExtrem|
|00000760| 65 50 6f 73 20 3d 20 33 | 32 37 36 37 20 2d 20 31 |ePos = 3|2767 - 1|
|00000770| 3b 20 2f 2f 20 72 65 71 | 75 69 72 65 64 20 74 6f |; // req|uired to|
|00000780| 20 61 64 64 72 65 73 73 | 20 61 6e 20 6f 6c 64 20 | address| an old |
|00000790| 72 65 67 69 6f 6e 20 62 | 75 67 0d 0d 2f 2f 20 6b |region b|ug..// k|
|000007a0| 4d 61 78 4f 70 65 6e 44 | 6f 63 75 6d 65 6e 74 73 |MaxOpenD|ocuments|
|000007b0| 20 69 73 20 75 73 65 64 | 20 74 6f 20 64 65 74 65 | is used| to dete|
|000007c0| 72 6d 69 6e 65 20 77 68 | 65 74 68 65 72 20 61 20 |rmine wh|ether a |
|000007d0| 6e 65 77 20 64 6f 63 75 | 6d 65 6e 74 20 63 61 6e |new docu|ment can|
|000007e0| 20 62 65 20 6f 70 65 6e | 65 64 0d 2f 2f 20 6f 72 | be open|ed.// or|
|000007f0| 20 63 72 65 61 74 65 64 | 2e 20 57 65 20 6b 65 65 | created|. We kee|
|00000800| 70 20 74 72 61 63 6b 20 | 6f 66 20 74 68 65 20 6e |p track |of the n|
|00000810| 75 6d 62 65 72 20 6f 66 | 20 6f 70 65 6e 20 64 6f |umber of| open do|
|00000820| 63 75 6d 65 6e 74 73 2c | 20 61 6e 64 20 64 69 73 |cuments,| and dis|
|00000830| 61 62 6c 65 20 74 68 65 | 0d 2f 2f 20 6d 65 6e 75 |able the|.// menu|
|00000840| 20 69 74 65 6d 73 20 74 | 68 61 74 20 63 72 65 61 | items t|hat crea|
|00000850| 74 65 20 61 20 6e 65 77 | 20 64 6f 63 75 6d 65 6e |te a new| documen|
|00000860| 74 20 77 68 65 6e 20 74 | 68 65 20 6d 61 78 69 6d |t when t|he maxim|
|00000870| 75 6d 20 69 73 20 72 65 | 61 63 68 65 64 2e 20 49 |um is re|ached. I|
|00000880| 66 20 74 68 65 0d 2f 2f | 20 6e 75 6d 62 65 72 20 |f the.//| number |
|00000890| 6f 66 20 64 6f 63 75 6d | 65 6e 74 73 20 66 61 6c |of docum|ents fal|
|000008a0| 6c 73 20 62 65 6c 6f 77 | 20 74 68 65 20 6d 61 78 |ls below| the max|
|000008b0| 69 6d 75 6d 2c 20 74 68 | 65 20 69 74 65 6d 73 20 |imum, th|e items |
|000008c0| 61 72 65 20 65 6e 61 62 | 6c 65 64 20 61 67 61 69 |are enab|led agai|
|000008d0| 6e 2e 0d 63 6f 6e 73 74 | 20 73 68 6f 72 74 09 6b |n..const| short.k|
|000008e0| 4d 61 78 4f 70 65 6e 44 | 6f 63 75 6d 65 6e 74 73 |MaxOpenD|ocuments|
|000008f0| 20 3d 20 34 3b 0d 0d 63 | 6f 6e 73 74 20 4f 53 54 | = 4;..c|onst OST|
|00000900| 79 70 65 20 6b 43 72 65 | 61 74 6f 72 54 79 70 65 |ype kCre|atorType|
|00000910| 20 3d 20 27 4d 4f 4f 54 | 27 3b 0d 0d 2f 2f 20 44 | = 'MOOT|';..// D|
|00000920| 65 66 69 6e 65 20 6d 61 | 78 20 61 6e 64 20 6d 69 |efine ma|x and mi|
|00000930| 6e 20 6d 61 63 72 6f 73 | 20 66 6f 72 20 65 66 66 |n macros| for eff|
|00000940| 69 63 69 65 6e 63 79 2e | 0d 23 64 65 66 69 6e 65 |iciency.|.#define|
|00000950| 20 6d 61 78 28 61 2c 62 | 29 09 09 28 28 61 29 20 | max(a,b|)..((a) |
|00000960| 3e 20 28 62 29 20 3f 20 | 28 61 29 20 3a 20 28 62 |> (b) ? |(a) : (b|
|00000970| 29 29 0d 23 64 65 66 69 | 6e 65 20 6d 69 6e 28 61 |)).#defi|ne min(a|
|00000980| 2c 62 29 09 09 28 28 61 | 29 20 3c 20 28 62 29 20 |,b)..((a|) < (b) |
|00000990| 3f 20 28 61 29 20 3a 20 | 28 62 29 29 0d 0d 2f 2f |? (a) : |(b))..//|
|000009a0| 20 6d 61 69 6e 20 69 73 | 20 74 68 65 20 65 6e 74 | main is| the ent|
|000009b0| 72 79 70 6f 69 6e 74 20 | 74 6f 20 74 68 65 20 70 |rypoint |to the p|
|000009c0| 72 6f 67 72 61 6d 0d 69 | 6e 74 20 6d 61 69 6e 28 |rogram.i|nt main(|
|000009d0| 29 0d 7b 0d 09 2f 2f 20 | 43 72 65 61 74 65 20 6f |).{..// |Create o|
|000009e0| 75 72 20 61 70 70 6c 69 | 63 61 74 69 6f 6e 20 6f |ur appli|cation o|
|000009f0| 62 6a 65 63 74 2e 20 54 | 68 69 73 20 4d 55 53 54 |bject. T|his MUST|
|00000a00| 20 62 65 20 74 68 65 20 | 46 49 52 53 54 20 74 68 | be the |FIRST th|
|00000a10| 69 6e 67 0d 09 2f 2f 20 | 64 6f 6e 65 20 69 6e 20 |ing..// |done in |
|00000a20| 6d 61 69 6e 28 29 2c 20 | 73 69 6e 63 65 20 69 74 |main(), |since it|
|00000a30| 20 69 6e 69 74 69 61 6c | 69 7a 65 73 20 74 68 65 | initial|izes the|
|00000a40| 20 54 6f 6f 6c 62 6f 78 | 20 66 6f 72 20 75 73 2e | Toolbox| for us.|
|00000a50| 0d 09 2f 2f 20 41 6e 64 | 20 73 69 6e 63 65 20 77 |..// And| since w|
|00000a60| 65 20 72 65 61 6c 6c 79 | 20 64 6f 6e d5 74 20 6e |e really| don.t n|
|00000a70| 65 65 64 20 6d 6f 72 65 | 20 74 68 61 6e 20 6f 6e |eed more| than on|
|00000a80| 65 2c 20 61 6e 64 20 73 | 69 6e 63 65 0d 09 2f 2f |e, and s|ince..//|
|00000a90| 20 69 74 d5 73 20 66 61 | 73 74 65 72 20 61 6e 64 | it.s fa|ster and|
|00000aa0| 20 6c 65 73 73 20 68 65 | 61 70 2d 66 72 61 67 6d | less he|ap-fragm|
|00000ab0| 65 6e 74 69 6e 67 20 74 | 6f 20 61 6c 6c 6f 63 61 |enting t|o alloca|
|00000ac0| 74 65 20 69 74 20 6f 6e | 20 74 68 65 0d 09 2f 2f |te it on| the..//|
|00000ad0| 20 73 74 61 63 6b 2c 20 | 77 65 20 64 6f 2e 0d 09 | stack, |we do...|
|00000ae0| 54 45 53 61 6d 70 6c 65 | 09 74 68 65 41 70 70 3b |TESample|.theApp;|
|00000af0| 0d 0d 09 74 68 65 41 70 | 70 2e 50 72 6f 63 65 73 |...theAp|p.Proces|
|00000b00| 73 41 72 67 73 28 29 3b | 0d 0d 09 2f 2f 20 53 74 |sArgs();|...// St|
|00000b10| 61 72 74 20 6f 75 72 20 | 6d 61 69 6e 20 65 76 65 |art our |main eve|
|00000b20| 6e 74 20 6c 6f 6f 70 20 | 72 75 6e 6e 69 6e 67 2e |nt loop |running.|
|00000b30| 20 54 68 69 73 20 77 6f | 6e 27 74 20 72 65 74 75 | This wo|n't retu|
|00000b40| 72 6e 20 75 6e 74 69 6c | 20 75 73 65 72 20 71 75 |rn until| user qu|
|00000b50| 69 74 73 0d 09 74 68 65 | 41 70 70 2e 45 76 65 6e |its..the|App.Even|
|00000b60| 74 4c 6f 6f 70 28 29 3b | 0d 0d 09 2f 2f 20 57 65 |tLoop();|...// We|
|00000b70| 20 61 6c 77 61 79 73 20 | 72 65 74 75 72 6e 20 61 | always |return a|
|00000b80| 20 76 61 6c 75 65 2c 20 | 6c 69 6b 65 20 67 6f 6f | value, |like goo|
|00000b90| 64 20 6c 69 74 74 6c 65 | 20 41 4e 53 49 20 77 6f |d little| ANSI wo|
|00000ba0| 72 73 68 69 70 70 65 72 | 73 2c 0d 09 2f 2f 20 73 |rshipper|s,..// s|
|00000bb0| 6f 20 74 68 61 74 20 74 | 68 65 20 63 6f 6d 70 69 |o that t|he compi|
|00000bc0| 6c 65 72 20 77 6f 6e 27 | 74 20 63 6f 6d 70 6c 61 |ler won'|t compla|
|00000bd0| 69 6e 0d 09 72 65 74 75 | 72 6e 20 30 3b 0d 7d 0d |in..retu|rn 0;.}.|
|00000be0| 0d 2f 2f 20 74 68 65 20 | 63 6f 6e 73 74 72 75 63 |.// the |construc|
|00000bf0| 74 6f 72 20 66 6f 72 20 | 6f 75 72 20 63 6c 61 73 |tor for |our clas|
|00000c00| 73 2c 20 63 61 6c 6c 65 | 64 20 61 75 74 6f 6d 61 |s, calle|d automa|
|00000c10| 74 69 63 61 6c 6c 79 20 | 77 68 65 6e 20 77 65 20 |tically |when we |
|00000c20| 63 72 65 61 74 65 0d 2f | 2f 20 61 6e 20 69 6e 73 |create./|/ an ins|
|00000c30| 74 61 6e 63 65 20 6f 66 | 20 74 68 69 73 20 63 6c |tance of| this cl|
|00000c40| 61 73 73 2e 20 49 6e 20 | 74 68 69 73 20 70 61 72 |ass. In |this par|
|00000c50| 74 69 63 75 6c 61 72 20 | 63 61 73 65 2c 20 77 65 |ticular |case, we|
|00000c60| 20 6f 6e 6c 79 20 77 61 | 6e 74 0d 2f 2f 20 6f 6e | only wa|nt.// on|
|00000c70| 65 20 69 6e 73 74 61 6e | 63 65 20 73 69 6e 63 65 |e instan|ce since|
|00000c80| 20 74 68 65 20 63 6f 6e | 73 74 72 75 63 74 6f 72 | the con|structor|
|00000c90| 20 64 6f 65 73 20 61 6c | 6c 20 74 68 65 20 6d 65 | does al|l the me|
|00000ca0| 6e 75 20 73 65 74 75 70 | 73 20 61 6e 64 0d 2f 2f |nu setup|s and.//|
|00000cb0| 20 63 72 65 61 74 65 73 | 20 6f 75 72 20 28 75 6e | creates| our (un|
|00000cc0| 74 69 74 6c 65 64 29 20 | 64 6f 63 75 6d 65 6e 74 |titled) |document|
|00000cd0| 2e 0d 2f 2f 20 4e 6f 74 | 65 20 74 68 61 74 20 77 |..// Not|e that w|
|00000ce0| 65 20 63 61 6c 6c 20 6f | 75 72 20 62 61 73 65 20 |e call o|ur base |
|00000cf0| 54 41 70 70 6c 69 63 61 | 74 69 6f 6e 20 63 6f 6e |TApplica|tion con|
|00000d00| 73 74 72 75 63 74 6f 72 | 2c 20 70 61 73 73 69 6e |structor|, passin|
|00000d10| 67 20 69 74 0d 2f 2f 20 | 6f 75 72 20 63 72 65 61 |g it.// |our crea|
|00000d20| 74 6f 72 20 73 69 67 6e | 61 74 75 72 65 20 63 6f |tor sign|ature co|
|00000d30| 6e 73 74 61 6e 74 2e 0d | 54 45 53 61 6d 70 6c 65 |nstant..|TESample|
|00000d40| 3a 3a 54 45 53 61 6d 70 | 6c 65 28 29 20 3a 20 54 |::TESamp|le() : T|
|00000d50| 41 70 70 6c 69 63 61 74 | 69 6f 6e 28 6b 43 72 65 |Applicat|ion(kCre|
|00000d60| 61 74 6f 72 54 79 70 65 | 29 0d 7b 0d 09 48 61 6e |atorType|).{..Han|
|00000d70| 64 6c 65 09 6d 65 6e 75 | 42 61 72 3b 0d 0d 09 2f |dle.menu|Bar;.../|
|00000d80| 2f 20 69 6e 69 74 69 61 | 6c 69 7a 65 20 41 70 70 |/ initia|lize App|
|00000d90| 6c 65 45 76 65 6e 74 20 | 63 6f 64 65 0d 09 4d 41 |leEvent |code..MA|
|00000da0| 70 70 6c 65 4f 62 6a 65 | 63 74 3a 3a 49 6e 69 74 |ppleObje|ct::Init|
|00000db0| 41 70 70 6c 65 4f 62 6a | 65 63 74 28 29 3b 0d 0d |AppleObj|ect();..|
|00000dc0| 09 2f 2f 20 72 65 61 64 | 20 6d 65 6e 75 73 20 69 |.// read| menus i|
|00000dd0| 6e 74 6f 20 6d 65 6e 75 | 20 62 61 72 0d 09 6d 65 |nto menu| bar..me|
|00000de0| 6e 75 42 61 72 20 3d 20 | 47 65 74 4e 65 77 4d 42 |nuBar = |GetNewMB|
|00000df0| 61 72 28 72 4d 65 6e 75 | 42 61 72 29 3b 0d 09 2f |ar(rMenu|Bar);../|
|00000e00| 2f 20 69 6e 73 74 61 6c | 6c 20 6d 65 6e 75 73 0d |/ instal|l menus.|
|00000e10| 09 53 65 74 4d 65 6e 75 | 42 61 72 28 6d 65 6e 75 |.SetMenu|Bar(menu|
|00000e20| 42 61 72 29 3b 0d 09 44 | 69 73 70 6f 73 48 61 6e |Bar);..D|isposHan|
|00000e30| 64 6c 65 28 6d 65 6e 75 | 42 61 72 29 3b 0d 09 2f |dle(menu|Bar);../|
|00000e40| 2f 20 61 64 64 20 44 41 | 20 6e 61 6d 65 73 20 74 |/ add DA| names t|
|00000e50| 6f 20 41 70 70 6c 65 20 | 6d 65 6e 75 0d 09 41 64 |o Apple |menu..Ad|
|00000e60| 64 52 65 73 4d 65 6e 75 | 28 47 65 74 4d 48 61 6e |dResMenu|(GetMHan|
|00000e70| 64 6c 65 28 6d 41 70 70 | 6c 65 29 2c 20 27 44 52 |dle(mApp|le), 'DR|
|00000e80| 56 52 27 29 3b 0d 09 2f | 2f 20 61 64 64 20 66 6f |VR');../|/ add fo|
|00000e90| 6e 74 20 6e 61 6d 65 73 | 20 74 6f 20 46 6f 6e 74 |nt names| to Font|
|00000ea0| 20 6d 65 6e 75 0d 09 41 | 64 64 52 65 73 4d 65 6e | menu..A|ddResMen|
|00000eb0| 75 28 47 65 74 4d 48 61 | 6e 64 6c 65 28 6d 46 6f |u(GetMHa|ndle(mFo|
|00000ec0| 6e 74 29 2c 20 27 46 4f | 4e 54 27 29 3b 0d 09 44 |nt), 'FO|NT');..D|
|00000ed0| 72 61 77 4d 65 6e 75 42 | 61 72 28 29 3b 0d 0d 09 |rawMenuB|ar();...|
|00000ee0| 2f 2f 20 63 72 65 61 74 | 65 20 65 6d 70 74 79 20 |// creat|e empty |
|00000ef0| 6d 6f 75 73 65 20 72 65 | 67 69 6f 6e 0d 09 66 4d |mouse re|gion..fM|
|00000f00| 6f 75 73 65 52 67 6e 20 | 3d 20 4e 65 77 52 67 6e |ouseRgn |= NewRgn|
|00000f10| 28 29 3b 0d 09 2f 2f 20 | 6d 61 6b 65 20 73 75 72 |();..// |make sur|
|00000f20| 65 20 77 65 20 68 61 76 | 65 20 61 20 76 61 6c 69 |e we hav|e a vali|
|00000f30| 64 20 63 75 72 73 6f 72 | 20 72 65 67 69 6f 6e 0d |d cursor| region.|
|00000f40| 09 41 64 6a 75 73 74 43 | 75 72 73 6f 72 28 29 3b |.AdjustC|ursor();|
|00000f50| 0d 0d 09 4d 41 70 70 6c | 65 4f 62 6a 65 63 74 3a |...MAppl|eObject:|
|00000f60| 3a 53 65 74 44 65 66 61 | 75 6c 74 41 70 70 6c 65 |:SetDefa|ultApple|
|00000f70| 4f 62 6a 65 63 74 28 74 | 68 69 73 29 3b 0d 7d 0d |Object(t|his);.}.|
|00000f80| 0d 54 45 53 61 6d 70 6c | 65 2a 20 54 45 53 61 6d |.TESampl|e* TESam|
|00000f90| 70 6c 65 3a 3a 47 65 74 | 54 45 41 70 70 6c 69 63 |ple::Get|TEApplic|
|00000fa0| 61 74 69 6f 6e 28 29 0d | 7b 0d 09 72 65 74 75 72 |ation().|{..retur|
|00000fb0| 6e 20 28 54 45 53 61 6d | 70 6c 65 2a 29 20 54 41 |n (TESam|ple*) TA|
|00000fc0| 70 70 6c 69 63 61 74 69 | 6f 6e 3a 3a 47 65 74 41 |pplicati|on::GetA|
|00000fd0| 70 70 6c 69 63 61 74 69 | 6f 6e 28 29 3b 0d 7d 0d |pplicati|on();.}.|
|00000fe0| 0d 2f 2f 20 54 65 6c 6c | 20 54 41 70 70 6c 69 63 |.// Tell| TApplic|
|00000ff0| 61 74 69 6f 6e 20 63 6c | 61 73 73 20 68 6f 77 20 |ation cl|ass how |
|00001000| 6d 75 63 68 20 68 65 61 | 70 20 77 65 20 6e 65 65 |much hea|p we nee|
|00001010| 64 0d 6c 6f 6e 67 20 54 | 45 53 61 6d 70 6c 65 3a |d.long T|ESample:|
|00001020| 3a 48 65 61 70 4e 65 65 | 64 65 64 28 29 0d 7b 0d |:HeapNee|ded().{.|
|00001030| 09 72 65 74 75 72 6e 20 | 28 6b 4d 69 6e 53 69 7a |.return |(kMinSiz|
|00001040| 65 20 2a 20 31 30 32 34 | 29 3b 0d 7d 0d 0d 2f 2f |e * 1024|);.}..//|
|00001050| 20 43 61 6c 63 75 6c 61 | 74 65 20 61 20 73 6c 65 | Calcula|te a sle|
|00001060| 65 70 20 76 61 6c 75 65 | 20 66 6f 72 20 57 61 69 |ep value| for Wai|
|00001070| 74 4e 65 78 74 45 76 65 | 6e 74 2e 20 54 68 69 73 |tNextEve|nt. This|
|00001080| 20 74 61 6b 65 73 20 69 | 6e 74 6f 20 61 63 63 6f | takes i|nto acco|
|00001090| 75 6e 74 20 74 68 65 20 | 74 68 69 6e 67 73 0d 2f |unt the |things./|
|000010a0| 2f 20 74 68 61 74 20 44 | 6f 49 64 6c 65 20 64 6f |/ that D|oIdle do|
|000010b0| 65 73 20 77 69 74 68 20 | 69 64 6c 65 20 74 69 6d |es with |idle tim|
|000010c0| 65 2e 0d 0d 75 6e 73 69 | 67 6e 65 64 20 6c 6f 6e |e...unsi|gned lon|
|000010d0| 67 20 54 45 53 61 6d 70 | 6c 65 3a 3a 53 6c 65 65 |g TESamp|le::Slee|
|000010e0| 70 56 61 6c 28 29 0d 7b | 0d 09 75 6e 73 69 67 6e |pVal().{|..unsign|
|000010f0| 65 64 20 6c 6f 6e 67 20 | 73 6c 65 65 70 3b 0d 0d |ed long |sleep;..|
|00001100| 09 73 6c 65 65 70 20 3d | 20 6b 4d 61 78 53 6c 65 |.sleep =| kMaxSle|
|00001110| 65 70 54 69 6d 65 3b 09 | 09 09 09 2f 2f 20 64 65 |epTime;.|...// de|
|00001120| 66 61 75 6c 74 20 76 61 | 6c 75 65 20 66 6f 72 20 |fault va|lue for |
|00001130| 73 6c 65 65 70 0d 09 2f | 2f 20 69 66 20 77 65 20 |sleep../|/ if we |
|00001140| 61 72 65 6e 27 74 20 69 | 6e 20 62 61 63 6b 67 72 |aren't i|n backgr|
|00001150| 6f 75 6e 64 2c 20 6c 65 | 74 20 64 6f 63 75 6d 65 |ound, le|t docume|
|00001160| 6e 74 20 74 65 6c 6c 20 | 75 73 20 68 6f 77 20 6c |nt tell |us how l|
|00001170| 6f 6e 67 20 74 6f 20 73 | 6c 65 65 70 0d 09 69 66 |ong to s|leep..if|
|00001180| 20 28 28 21 66 49 6e 42 | 61 63 6b 67 72 6f 75 6e | ((!fInB|ackgroun|
|00001190| 64 29 20 26 26 20 28 66 | 43 75 72 44 6f 63 20 21 |d) && (f|CurDoc !|
|000011a0| 3d 20 6e 69 6c 29 29 0d | 09 20 20 73 6c 65 65 70 |= nil)).|. sleep|
|000011b0| 20 3d 20 6d 69 6e 28 73 | 6c 65 65 70 2c 66 43 75 | = min(s|leep,fCu|
|000011c0| 72 44 6f 63 2d 3e 43 61 | 6c 63 49 64 6c 65 28 29 |rDoc->Ca|lcIdle()|
|000011d0| 29 3b 0d 09 72 65 74 75 | 72 6e 20 73 6c 65 65 70 |);..retu|rn sleep|
|000011e0| 3b 0d 7d 0d 0d 2f 2f 20 | 54 68 69 73 20 69 73 20 |;.}..// |This is |
|000011f0| 63 61 6c 6c 65 64 20 77 | 68 65 6e 65 76 65 72 20 |called w|henever |
|00001200| 77 65 20 67 65 74 20 61 | 20 6e 75 6c 6c 20 65 76 |we get a| null ev|
|00001210| 65 6e 74 20 65 74 20 61 | 6c 2e 0d 2f 2f 20 49 74 |ent et a|l..// It|
|00001220| 20 74 61 6b 65 73 20 63 | 61 72 65 20 6f 66 20 6e | takes c|are of n|
|00001230| 65 63 65 73 73 61 72 79 | 20 70 65 72 69 6f 64 69 |ecessary| periodi|
|00001240| 63 20 61 63 74 69 6f 6e | 73 2e 20 46 6f 72 20 74 |c action|s. For t|
|00001250| 68 69 73 20 70 72 6f 67 | 72 61 6d 2c 0d 2f 2f 20 |his prog|ram,.// |
|00001260| 69 74 20 63 61 6c 6c 73 | 20 54 45 49 64 6c 65 2e |it calls| TEIdle.|
|00001270| 0d 0d 76 6f 69 64 20 54 | 45 53 61 6d 70 6c 65 3a |..void T|ESample:|
|00001280| 3a 44 6f 49 64 6c 65 28 | 29 0d 7b 0d 09 54 45 44 |:DoIdle(|).{..TED|
|00001290| 6f 63 75 6d 65 6e 74 2a | 20 66 54 45 43 75 72 44 |ocument*| fTECurD|
|000012a0| 6f 63 20 3d 20 28 54 45 | 44 6f 63 75 6d 65 6e 74 |oc = (TE|Document|
|000012b0| 2a 29 20 66 43 75 72 44 | 6f 63 3b 0d 0d 09 69 66 |*) fCurD|oc;...if|
|000012c0| 20 28 66 54 45 43 75 72 | 44 6f 63 20 21 3d 20 6e | (fTECur|Doc != n|
|000012d0| 69 6c 29 0d 09 20 20 66 | 54 45 43 75 72 44 6f 63 |il).. f|TECurDoc|
|000012e0| 2d 3e 44 6f 49 64 6c 65 | 28 29 3b 0d 7d 20 2f 2f |->DoIdle|();.} //|
|000012f0| 20 44 6f 49 64 6c 65 0d | 0d 2f 2f 20 43 68 61 6e | DoIdle.|.// Chan|
|00001300| 67 65 20 74 68 65 20 63 | 75 72 73 6f 72 27 73 20 |ge the c|ursor's |
|00001310| 73 68 61 70 65 2c 20 64 | 65 70 65 6e 64 69 6e 67 |shape, d|epending|
|00001320| 20 6f 6e 20 69 74 73 20 | 70 6f 73 69 74 69 6f 6e | on its |position|
|00001330| 2e 20 54 68 69 73 20 61 | 6c 73 6f 20 63 61 6c 63 |. This a|lso calc|
|00001340| 75 6c 61 74 65 73 20 61 | 0d 2f 2f 20 72 65 67 69 |ulates a|.// regi|
|00001350| 6f 6e 20 74 68 61 74 20 | 69 6e 63 6c 75 64 65 73 |on that |includes|
|00001360| 20 74 68 65 20 63 75 72 | 73 6f 72 20 66 6f 72 20 | the cur|sor for |
|00001370| 57 61 69 74 4e 65 78 74 | 45 76 65 6e 74 2e 0d 0d |WaitNext|Event...|
|00001380| 76 6f 69 64 20 54 45 53 | 61 6d 70 6c 65 3a 3a 41 |void TES|ample::A|
|00001390| 64 6a 75 73 74 43 75 72 | 73 6f 72 28 29 0d 7b 0d |djustCur|sor().{.|
|000013a0| 09 54 45 44 6f 63 75 6d | 65 6e 74 2a 20 66 54 45 |.TEDocum|ent* fTE|
|000013b0| 43 75 72 44 6f 63 20 3d | 20 28 54 45 44 6f 63 75 |CurDoc =| (TEDocu|
|000013c0| 6d 65 6e 74 2a 29 20 66 | 43 75 72 44 6f 63 3b 0d |ment*) f|CurDoc;.|
|000013d0| 0d 09 2f 2f 20 6e 6f 74 | 69 63 65 20 74 68 61 74 |..// not|ice that|
|000013e0| 20 77 65 20 64 6f 6e 27 | 74 20 63 68 61 6e 67 65 | we don'|t change|
|000013f0| 20 63 75 72 73 6f 72 20 | 69 66 20 66 72 6f 6e 74 | cursor |if front|
|00001400| 20 77 69 6e 64 6f 77 20 | 69 73 6e 27 74 20 6f 75 | window |isn't ou|
|00001410| 72 73 0d 09 69 66 20 28 | 20 28 21 66 49 6e 42 61 |rs..if (| (!fInBa|
|00001420| 63 6b 67 72 6f 75 6e 64 | 29 20 26 26 20 28 66 54 |ckground|) && (fT|
|00001430| 45 43 75 72 44 6f 63 20 | 21 3d 20 6e 69 6c 29 20 |ECurDoc |!= nil) |
|00001440| 29 0d 09 20 20 7b 0d 09 | 09 52 67 6e 48 61 6e 64 |).. {..|.RgnHand|
|00001450| 6c 65 09 61 72 72 6f 77 | 52 67 6e 3b 0d 09 09 52 |le.arrow|Rgn;...R|
|00001460| 67 6e 48 61 6e 64 6c 65 | 09 69 42 65 61 6d 52 67 |gnHandle|.iBeamRg|
|00001470| 6e 3b 0d 09 09 50 6f 69 | 6e 74 09 09 6d 6f 75 73 |n;...Poi|nt..mous|
|00001480| 65 3b 0d 0d 09 09 2f 2f | 20 67 65 74 20 6d 6f 75 |e;....//| get mou|
|00001490| 73 65 20 6c 6f 63 61 74 | 69 6f 6e 20 61 6e 64 20 |se locat|ion and |
|000014a0| 63 6f 6e 76 65 72 74 20 | 74 6f 20 67 6c 6f 62 61 |convert |to globa|
|000014b0| 6c 20 63 6f 6f 72 64 69 | 6e 61 74 65 73 0d 09 09 |l coordi|nates...|
|000014c0| 47 65 74 4d 6f 75 73 65 | 28 26 6d 6f 75 73 65 29 |GetMouse|(&mouse)|
|000014d0| 3b 0d 09 09 4c 6f 63 61 | 6c 54 6f 47 6c 6f 62 61 |;...Loca|lToGloba|
|000014e0| 6c 28 26 6d 6f 75 73 65 | 29 3b 0d 0d 09 09 2f 2f |l(&mouse|);....//|
|000014f0| 20 63 61 6c 63 75 6c 61 | 74 65 20 72 65 67 69 6f | calcula|te regio|
|00001500| 6e 73 20 66 6f 72 20 64 | 69 66 66 65 72 65 6e 74 |ns for d|ifferent|
|00001510| 20 63 75 72 73 6f 72 20 | 73 68 61 70 65 73 0d 09 | cursor |shapes..|
|00001520| 09 61 72 72 6f 77 52 67 | 6e 20 3d 20 4e 65 77 52 |.arrowRg|n = NewR|
|00001530| 67 6e 28 29 3b 0d 09 09 | 69 42 65 61 6d 52 67 6e |gn();...|iBeamRgn|
|00001540| 20 3d 20 4e 65 77 52 67 | 6e 28 29 3b 0d 09 09 2f | = NewRg|n();.../|
|00001550| 2f 20 73 74 61 72 74 20 | 61 72 72 6f 77 52 67 6e |/ start |arrowRgn|
|00001560| 20 77 69 64 65 20 6f 70 | 65 6e 0d 09 09 53 65 74 | wide op|en...Set|
|00001570| 52 65 63 74 52 67 6e 28 | 61 72 72 6f 77 52 67 6e |RectRgn(|arrowRgn|
|00001580| 2c 20 6b 45 78 74 72 65 | 6d 65 4e 65 67 2c 20 6b |, kExtre|meNeg, k|
|00001590| 45 78 74 72 65 6d 65 4e | 65 67 2c 20 6b 45 78 74 |ExtremeN|eg, kExt|
|000015a0| 72 65 6d 65 50 6f 73 2c | 20 6b 45 78 74 72 65 6d |remePos,| kExtrem|
|000015b0| 65 50 6f 73 29 3b 0d 09 | 09 2f 2f 20 63 61 6c 63 |ePos);..|.// calc|
|000015c0| 75 6c 61 74 65 20 69 42 | 65 61 6d 52 67 6e 0d 09 |ulate iB|eamRgn..|
|000015d0| 09 66 54 45 43 75 72 44 | 6f 63 2d 3e 47 65 74 56 |.fTECurD|oc->GetV|
|000015e0| 69 73 54 45 52 67 6e 28 | 69 42 65 61 6d 52 67 6e |isTERgn(|iBeamRgn|
|000015f0| 29 3b 0d 09 09 2f 2f 20 | 73 75 62 74 72 61 63 74 |);...// |subtract|
|00001600| 20 69 42 65 61 6d 52 67 | 6e 20 66 72 6f 6d 20 61 | iBeamRg|n from a|
|00001610| 72 72 6f 77 52 67 6e 0d | 09 09 44 69 66 66 52 67 |rrowRgn.|..DiffRg|
|00001620| 6e 28 61 72 72 6f 77 52 | 67 6e 2c 20 69 42 65 61 |n(arrowR|gn, iBea|
|00001630| 6d 52 67 6e 2c 20 61 72 | 72 6f 77 52 67 6e 29 3b |mRgn, ar|rowRgn);|
|00001640| 0d 0d 09 09 2f 2f 20 63 | 68 61 6e 67 65 20 74 68 |....// c|hange th|
|00001650| 65 20 63 75 72 73 6f 72 | 20 61 6e 64 20 74 68 65 |e cursor| and the|
|00001660| 20 72 65 67 69 6f 6e 20 | 70 61 72 61 6d 65 74 65 | region |paramete|
|00001670| 72 0d 09 09 69 66 20 28 | 50 74 49 6e 52 67 6e 28 |r...if (|PtInRgn(|
|00001680| 6d 6f 75 73 65 2c 20 69 | 42 65 61 6d 52 67 6e 29 |mouse, i|BeamRgn)|
|00001690| 29 0d 09 09 20 20 7b 0d | 09 09 09 53 65 74 43 75 |)... {.|...SetCu|
|000016a0| 72 73 6f 72 28 2a 47 65 | 74 43 75 72 73 6f 72 28 |rsor(*Ge|tCursor(|
|000016b0| 69 42 65 61 6d 43 75 72 | 73 6f 72 29 29 3b 0d 09 |iBeamCur|sor));..|
|000016c0| 09 09 43 6f 70 79 52 67 | 6e 28 69 42 65 61 6d 52 |..CopyRg|n(iBeamR|
|000016d0| 67 6e 2c 20 66 4d 6f 75 | 73 65 52 67 6e 29 3b 0d |gn, fMou|seRgn);.|
|000016e0| 09 09 20 20 7d 0d 09 09 | 65 6c 73 65 0d 09 09 20 |.. }...|else... |
|000016f0| 20 7b 0d 09 09 09 53 65 | 74 43 75 72 73 6f 72 28 | {....Se|tCursor(|
|00001700| 26 71 64 2e 61 72 72 6f | 77 29 3b 0d 09 09 09 43 |&qd.arro|w);....C|
|00001710| 6f 70 79 52 67 6e 28 61 | 72 72 6f 77 52 67 6e 2c |opyRgn(a|rrowRgn,|
|00001720| 20 66 4d 6f 75 73 65 52 | 67 6e 29 3b 0d 09 09 20 | fMouseR|gn);... |
|00001730| 20 7d 0d 09 09 2f 2f 20 | 67 65 74 20 72 69 64 20 | }...// |get rid |
|00001740| 6f 66 20 72 65 67 69 6f | 6e 73 20 77 65 20 64 6f |of regio|ns we do|
|00001750| 6e 27 74 20 6e 65 65 64 | 20 61 6e 79 6d 6f 72 65 |n't need| anymore|
|00001760| 0d 09 09 44 69 73 70 6f | 73 65 52 67 6e 28 61 72 |...Dispo|seRgn(ar|
|00001770| 72 6f 77 52 67 6e 29 3b | 0d 09 09 44 69 73 70 6f |rowRgn);|...Dispo|
|00001780| 73 65 52 67 6e 28 69 42 | 65 61 6d 52 67 6e 29 3b |seRgn(iB|eamRgn);|
|00001790| 0d 09 20 20 7d 0d 7d 20 | 2f 2f 20 41 64 6a 75 73 |.. }.} |// Adjus|
|000017a0| 74 43 75 72 73 6f 72 0d | 0d 2f 2f 20 45 6e 61 62 |tCursor.|.// Enab|
|000017b0| 6c 65 20 61 6e 64 20 64 | 69 73 61 62 6c 65 20 6d |le and d|isable m|
|000017c0| 65 6e 75 73 20 62 61 73 | 65 64 20 6f 6e 20 74 68 |enus bas|ed on th|
|000017d0| 65 20 63 75 72 72 65 6e | 74 20 73 74 61 74 65 2e |e curren|t state.|
|000017e0| 20 54 68 65 0d 2f 2f 20 | 75 73 65 72 20 63 61 6e | The.// |user can|
|000017f0| 20 6f 6e 6c 79 20 73 65 | 6c 65 63 74 20 65 6e 61 | only se|lect ena|
|00001800| 62 6c 65 64 20 6d 65 6e | 75 20 69 74 65 6d 73 2e |bled men|u items.|
|00001810| 20 57 65 20 73 65 74 20 | 75 70 20 61 6c 6c 20 74 | We set |up all t|
|00001820| 68 65 0d 2f 2f 20 6d 65 | 6e 75 20 69 74 65 6d 73 |he.// me|nu items|
|00001830| 20 62 65 66 6f 72 65 20 | 63 61 6c 6c 69 6e 67 20 | before |calling |
|00001840| 4d 65 6e 75 53 65 6c 65 | 63 74 20 6f 72 20 4d 65 |MenuSele|ct or Me|
|00001850| 6e 75 4b 65 79 2c 20 73 | 69 6e 63 65 0d 2f 2f 20 |nuKey, s|ince.// |
|00001860| 74 68 65 73 65 20 61 72 | 65 20 74 68 65 20 6f 6e |these ar|e the on|
|00001870| 6c 79 20 74 69 6d 65 73 | 20 74 68 61 74 20 61 20 |ly times| that a |
|00001880| 6d 65 6e 75 20 69 74 65 | 6d 20 63 61 6e 20 62 65 |menu ite|m can be|
|00001890| 20 73 65 6c 65 63 74 65 | 64 2e 0d 2f 2f 20 4e 6f | selecte|d..// No|
|000018a0| 74 65 20 74 68 61 74 20 | 4d 65 6e 75 53 65 6c 65 |te that |MenuSele|
|000018b0| 63 74 20 69 73 20 61 6c | 73 6f 20 74 68 65 20 6f |ct is al|so the o|
|000018c0| 6e 6c 79 20 74 69 6d 65 | 20 74 68 65 20 75 73 65 |nly time| the use|
|000018d0| 72 20 77 69 6c 6c 0d 2f | 2f 20 73 65 65 20 6d 65 |r will./|/ see me|
|000018e0| 6e 75 20 69 74 65 6d 73 | 2e 20 54 68 69 73 20 61 |nu items|. This a|
|000018f0| 70 70 72 6f 61 63 68 20 | 74 6f 20 64 65 63 69 64 |pproach |to decid|
|00001900| 69 6e 67 20 77 68 61 74 | 20 65 6e 61 62 6c 65 2f |ing what| enable/|
|00001910| 0d 2f 2f 20 64 69 73 61 | 62 6c 65 20 73 74 61 74 |.// disa|ble stat|
|00001920| 65 20 61 20 6d 65 6e 75 | 20 69 74 65 6d 20 68 61 |e a menu| item ha|
|00001930| 73 20 74 68 65 20 61 64 | 76 61 6e 74 61 67 65 20 |s the ad|vantage |
|00001940| 6f 66 0d 2f 2f 20 63 6f | 6e 63 65 6e 74 72 61 74 |of.// co|ncentrat|
|00001950| 69 6e 67 20 61 6c 6c 20 | 74 68 65 20 64 65 63 69 |ing all |the deci|
|00001960| 73 69 6f 6e 2d 6d 61 6b | 69 6e 67 20 69 6e 20 6f |sion-mak|ing in o|
|00001970| 6e 65 20 72 6f 75 74 69 | 6e 65 2c 20 61 73 0d 2f |ne routi|ne, as./|
|00001980| 2f 20 6f 70 70 6f 73 65 | 64 20 74 6f 20 62 65 69 |/ oppose|d to bei|
|00001990| 6e 67 20 73 70 72 65 61 | 64 20 74 68 72 6f 75 67 |ng sprea|d throug|
|000019a0| 68 6f 75 74 20 74 68 65 | 20 61 70 70 6c 69 63 61 |hout the| applica|
|000019b0| 74 69 6f 6e 2e 20 4f 74 | 68 65 72 0d 2f 2f 20 61 |tion. Ot|her.// a|
|000019c0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 64 65 73 69 67 |pplicati|on desig|
|000019d0| 6e 73 20 6d 61 79 20 74 | 61 6b 65 20 61 20 64 69 |ns may t|ake a di|
|000019e0| 66 66 65 72 65 6e 74 20 | 61 70 70 72 6f 61 63 68 |fferent |approach|
|000019f0| 20 74 68 61 74 20 6d 61 | 79 0d 2f 2f 20 6f 72 20 | that ma|y.// or |
|00001a00| 6d 61 79 20 6e 6f 74 20 | 62 65 20 61 73 20 76 61 |may not |be as va|
|00001a10| 6c 69 64 2e 0d 0d 76 6f | 69 64 20 54 45 53 61 6d |lid...vo|id TESam|
|00001a20| 70 6c 65 3a 3a 41 64 6a | 75 73 74 4d 65 6e 75 73 |ple::Adj|ustMenus|
|00001a30| 28 29 0d 7b 0d 09 57 69 | 6e 64 6f 77 50 74 72 09 |().{..Wi|ndowPtr.|
|00001a40| 66 72 6f 6e 74 6d 6f 73 | 74 3b 0d 09 4d 65 6e 75 |frontmos|t;..Menu|
|00001a50| 48 61 6e 64 6c 65 09 66 | 69 6c 65 4d 65 6e 75 2c |Handle.f|ileMenu,|
|00001a60| 20 65 64 69 74 4d 65 6e | 75 3b 0d 09 6c 6f 6e 67 | editMen|u;..long|
|00001a70| 09 09 6f 66 66 73 65 74 | 3b 0d 09 42 6f 6f 6c 65 |..offset|;..Boole|
|00001a80| 61 6e 09 09 75 6e 64 6f | 3b 0d 09 42 6f 6f 6c 65 |an..undo|;..Boole|
|00001a90| 61 6e 09 09 63 75 74 43 | 6f 70 79 43 6c 65 61 72 |an..cutC|opyClear|
|00001aa0| 3b 0d 09 42 6f 6f 6c 65 | 61 6e 09 09 70 61 73 74 |;..Boole|an..past|
|00001ab0| 65 3b 0d 09 42 6f 6f 6c | 65 61 6e 09 09 73 61 76 |e;..Bool|ean..sav|
|00001ac0| 65 2c 20 73 61 76 65 41 | 73 3b 0d 09 42 6f 6f 6c |e, saveA|s;..Bool|
|00001ad0| 65 61 6e 09 09 73 65 6c | 65 63 74 41 6c 6c 3b 0d |ean..sel|ectAll;.|
|00001ae0| 09 54 45 44 6f 63 75 6d | 65 6e 74 2a 20 66 54 45 |.TEDocum|ent* fTE|
|00001af0| 43 75 72 44 6f 63 20 3d | 20 28 54 45 44 6f 63 75 |CurDoc =| (TEDocu|
|00001b00| 6d 65 6e 74 2a 29 20 66 | 43 75 72 44 6f 63 3b 0d |ment*) f|CurDoc;.|
|00001b10| 0d 09 66 72 6f 6e 74 6d | 6f 73 74 20 3d 20 46 72 |..frontm|ost = Fr|
|00001b20| 6f 6e 74 57 69 6e 64 6f | 77 28 29 3b 0d 0d 09 66 |ontWindo|w();...f|
|00001b30| 69 6c 65 4d 65 6e 75 20 | 3d 20 47 65 74 4d 48 61 |ileMenu |= GetMHa|
|00001b40| 6e 64 6c 65 28 6d 46 69 | 6c 65 29 3b 0d 09 69 66 |ndle(mFi|le);..if|
|00001b50| 20 28 66 44 6f 63 4c 69 | 73 74 2d 3e 4e 75 6d 44 | (fDocLi|st->NumD|
|00001b60| 6f 63 73 28 29 20 3c 20 | 6b 4d 61 78 4f 70 65 6e |ocs() < |kMaxOpen|
|00001b70| 44 6f 63 75 6d 65 6e 74 | 73 29 0d 09 20 20 7b 0d |Document|s).. {.|
|00001b80| 09 09 2f 2f 20 4e 65 77 | 20 26 20 4f 70 65 6e 20 |..// New| & Open |
|00001b90| 61 72 65 20 65 6e 61 62 | 6c 65 64 20 77 68 65 6e |are enab|led when|
|00001ba0| 20 77 65 20 63 61 6e 20 | 6f 70 65 6e 20 6d 6f 72 | we can |open mor|
|00001bb0| 65 20 64 6f 63 75 6d 65 | 6e 74 73 0d 09 09 45 6e |e docume|nts...En|
|00001bc0| 61 62 6c 65 49 74 65 6d | 28 66 69 6c 65 4d 65 6e |ableItem|(fileMen|
|00001bd0| 75 2c 20 69 4e 65 77 29 | 3b 0d 09 09 45 6e 61 62 |u, iNew)|;...Enab|
|00001be0| 6c 65 49 74 65 6d 28 66 | 69 6c 65 4d 65 6e 75 2c |leItem(f|ileMenu,|
|00001bf0| 20 69 4f 70 65 6e 29 3b | 0d 09 20 20 7d 0d 09 65 | iOpen);|.. }..e|
|00001c00| 6c 73 65 0d 09 20 20 7b | 0d 09 09 44 69 73 61 62 |lse.. {|...Disab|
|00001c10| 6c 65 49 74 65 6d 28 66 | 69 6c 65 4d 65 6e 75 2c |leItem(f|ileMenu,|
|00001c20| 20 69 4e 65 77 29 3b 0d | 09 09 44 69 73 61 62 6c | iNew);.|..Disabl|
|00001c30| 65 49 74 65 6d 28 66 69 | 6c 65 4d 65 6e 75 2c 20 |eItem(fi|leMenu, |
|00001c40| 69 4f 70 65 6e 29 3b 0d | 09 20 20 7d 0d 09 69 66 |iOpen);.|. }..if|
|00001c50| 20 28 66 72 6f 6e 74 6d | 6f 73 74 20 21 3d 20 28 | (frontm|ost != (|
|00001c60| 57 69 6e 64 6f 77 50 74 | 72 29 20 6e 69 6c 29 09 |WindowPt|r) nil).|
|00001c70| 2f 2f 20 43 6c 6f 73 65 | 20 69 73 20 65 6e 61 62 |// Close| is enab|
|00001c80| 6c 65 64 20 77 68 65 6e | 20 74 68 65 72 65 20 69 |led when| there i|
|00001c90| 73 20 61 20 77 69 6e 64 | 6f 77 20 74 6f 20 63 6c |s a wind|ow to cl|
|00001ca0| 6f 73 65 0d 09 20 20 45 | 6e 61 62 6c 65 49 74 65 |ose.. E|nableIte|
|00001cb0| 6d 28 66 69 6c 65 4d 65 | 6e 75 2c 20 69 43 6c 6f |m(fileMe|nu, iClo|
|00001cc0| 73 65 29 3b 0d 09 65 6c | 73 65 20 44 69 73 61 62 |se);..el|se Disab|
|00001cd0| 6c 65 49 74 65 6d 28 66 | 69 6c 65 4d 65 6e 75 2c |leItem(f|ileMenu,|
|00001ce0| 20 69 43 6c 6f 73 65 29 | 3b 0d 0d 09 65 64 69 74 | iClose)|;...edit|
|00001cf0| 4d 65 6e 75 20 3d 20 47 | 65 74 4d 48 61 6e 64 6c |Menu = G|etMHandl|
|00001d00| 65 28 6d 45 64 69 74 29 | 3b 0d 09 75 6e 64 6f 20 |e(mEdit)|;..undo |
|00001d10| 3d 20 66 61 6c 73 65 3b | 0d 09 63 75 74 43 6f 70 |= false;|..cutCop|
|00001d20| 79 43 6c 65 61 72 20 3d | 20 66 61 6c 73 65 3b 0d |yClear =| false;.|
|00001d30| 09 70 61 73 74 65 20 3d | 20 66 61 6c 73 65 3b 0d |.paste =| false;.|
|00001d40| 09 73 61 76 65 20 3d 20 | 73 61 76 65 41 73 20 3d |.save = |saveAs =|
|00001d50| 20 66 61 6c 73 65 3b 0d | 09 73 65 6c 65 63 74 41 | false;.|.selectA|
|00001d60| 6c 6c 20 3d 20 66 61 6c | 73 65 3b 0d 09 69 66 20 |ll = fal|se;..if |
|00001d70| 28 66 72 6f 6e 74 6d 6f | 73 74 20 21 3d 20 6e 69 |(frontmo|st != ni|
|00001d80| 6c 29 0d 09 20 20 7b 0d | 09 09 73 65 6c 65 63 74 |l).. {.|..select|
|00001d90| 41 6c 6c 20 3d 20 74 72 | 75 65 3b 0d 09 09 69 66 |All = tr|ue;...if|
|00001da0| 20 28 66 43 75 72 44 6f | 63 20 3d 3d 20 6e 69 6c | (fCurDo|c == nil|
|00001db0| 29 0d 09 09 20 20 7b 0d | 09 09 09 75 6e 64 6f 20 |)... {.|...undo |
|00001dc0| 3d 20 74 72 75 65 3b 09 | 09 09 09 2f 2f 20 61 6c |= true;.|...// al|
|00001dd0| 6c 20 65 64 69 74 69 6e | 67 20 69 73 20 65 6e 61 |l editin|g is ena|
|00001de0| 62 6c 65 64 20 66 6f 72 | 20 44 41 20 77 69 6e 64 |bled for| DA wind|
|00001df0| 6f 77 73 0d 09 09 09 63 | 75 74 43 6f 70 79 43 6c |ows....c|utCopyCl|
|00001e00| 65 61 72 20 3d 20 74 72 | 75 65 3b 0d 09 09 09 70 |ear = tr|ue;....p|
|00001e10| 61 73 74 65 20 3d 20 74 | 72 75 65 3b 0d 09 09 20 |aste = t|rue;... |
|00001e20| 20 7d 0d 09 09 65 6c 73 | 65 0d 09 09 20 20 7b 0d | }...els|e... {.|
|00001e30| 09 09 09 2f 2f 20 43 75 | 74 2c 20 43 6f 70 79 2c |...// Cu|t, Copy,|
|00001e40| 20 61 6e 64 20 43 6c 65 | 61 72 20 69 73 20 65 6e | and Cle|ar is en|
|00001e50| 61 62 6c 65 64 20 66 6f | 72 20 61 70 70 2e 20 77 |abled fo|r app. w|
|00001e60| 69 6e 64 6f 77 73 20 77 | 69 74 68 20 73 65 6c 65 |indows w|ith sele|
|00001e70| 63 74 69 6f 6e 73 0d 09 | 09 09 69 66 20 28 20 66 |ctions..|..if ( f|
|00001e80| 54 45 43 75 72 44 6f 63 | 2d 3e 48 61 76 65 53 65 |TECurDoc|->HaveSe|
|00001e90| 6c 65 63 74 69 6f 6e 28 | 29 20 29 0d 09 09 09 20 |lection(|) ).... |
|00001ea0| 20 63 75 74 43 6f 70 79 | 43 6c 65 61 72 20 3d 20 | cutCopy|Clear = |
|00001eb0| 74 72 75 65 3b 0d 09 09 | 09 2f 2f 20 49 66 20 77 |true;...|.// If w|
|00001ec0| 65 20 68 61 76 65 20 61 | 6e 79 20 54 45 58 54 20 |e have a|ny TEXT |
|00001ed0| 69 6e 20 74 68 65 20 73 | 63 72 61 70 2c 20 65 6e |in the s|crap, en|
|00001ee0| 61 62 6c 65 20 70 61 73 | 74 65 0d 09 09 09 69 66 |able pas|te....if|
|00001ef0| 20 28 20 47 65 74 53 63 | 72 61 70 28 6e 69 6c 2c | ( GetSc|rap(nil,|
|00001f00| 20 27 54 45 58 54 27 2c | 20 26 6f 66 66 73 65 74 | 'TEXT',| &offset|
|00001f10| 29 20 29 0d 09 09 09 09 | 70 61 73 74 65 20 3d 20 |) ).....|paste = |
|00001f20| 74 72 75 65 3b 0d 09 09 | 09 2f 2f 20 65 6e 61 62 |true;...|.// enab|
|00001f30| 6c 65 20 73 61 76 65 20 | 69 66 20 77 65 20 61 72 |le save |if we ar|
|00001f40| 65 20 64 69 72 74 79 0d | 09 09 09 73 61 76 65 20 |e dirty.|...save |
|00001f50| 3d 20 66 43 75 72 44 6f | 63 2d 3e 43 61 6e 53 61 |= fCurDo|c->CanSa|
|00001f60| 76 65 28 29 3b 0d 09 09 | 09 73 61 76 65 41 73 20 |ve();...|.saveAs |
|00001f70| 3d 20 66 43 75 72 44 6f | 63 2d 3e 43 61 6e 53 61 |= fCurDo|c->CanSa|
|00001f80| 76 65 41 73 28 29 3b 0d | 09 09 20 20 7d 0d 09 20 |veAs();.|.. }.. |
|00001f90| 20 7d 0d 09 69 66 20 28 | 73 61 76 65 29 0d 09 20 | }..if (|save).. |
|00001fa0| 20 45 6e 61 62 6c 65 49 | 74 65 6d 28 66 69 6c 65 | EnableI|tem(file|
|00001fb0| 4d 65 6e 75 2c 20 69 53 | 61 76 65 29 3b 0d 09 65 |Menu, iS|ave);..e|
|00001fc0| 6c 73 65 20 44 69 73 61 | 62 6c 65 49 74 65 6d 28 |lse Disa|bleItem(|
|00001fd0| 66 69 6c 65 4d 65 6e 75 | 2c 20 69 53 61 76 65 29 |fileMenu|, iSave)|
|00001fe0| 3b 0d 09 69 66 20 28 73 | 61 76 65 41 73 29 0d 09 |;..if (s|aveAs)..|
|00001ff0| 20 20 45 6e 61 62 6c 65 | 49 74 65 6d 28 66 69 6c | Enable|Item(fil|
|00002000| 65 4d 65 6e 75 2c 20 69 | 53 61 76 65 41 73 29 3b |eMenu, i|SaveAs);|
|00002010| 0d 09 65 6c 73 65 20 44 | 69 73 61 62 6c 65 49 74 |..else D|isableIt|
|00002020| 65 6d 28 66 69 6c 65 4d | 65 6e 75 2c 20 69 53 61 |em(fileM|enu, iSa|
|00002030| 76 65 41 73 29 3b 0d 0d | 09 69 66 20 28 75 6e 64 |veAs);..|.if (und|
|00002040| 6f 29 0d 09 20 20 45 6e | 61 62 6c 65 49 74 65 6d |o).. En|ableItem|
|00002050| 28 65 64 69 74 4d 65 6e | 75 2c 20 69 55 6e 64 6f |(editMen|u, iUndo|
|00002060| 29 3b 0d 09 65 6c 73 65 | 20 44 69 73 61 62 6c 65 |);..else| Disable|
|00002070| 49 74 65 6d 28 65 64 69 | 74 4d 65 6e 75 2c 20 69 |Item(edi|tMenu, i|
|00002080| 55 6e 64 6f 29 3b 0d 09 | 69 66 20 28 20 63 75 74 |Undo);..|if ( cut|
|00002090| 43 6f 70 79 43 6c 65 61 | 72 20 29 0d 09 20 20 7b |CopyClea|r ).. {|
|000020a0| 0d 09 09 45 6e 61 62 6c | 65 49 74 65 6d 28 65 64 |...Enabl|eItem(ed|
|000020b0| 69 74 4d 65 6e 75 2c 20 | 69 43 75 74 29 3b 0d 09 |itMenu, |iCut);..|
|000020c0| 09 45 6e 61 62 6c 65 49 | 74 65 6d 28 65 64 69 74 |.EnableI|tem(edit|
|000020d0| 4d 65 6e 75 2c 20 69 43 | 6f 70 79 29 3b 0d 09 09 |Menu, iC|opy);...|
|000020e0| 45 6e 61 62 6c 65 49 74 | 65 6d 28 65 64 69 74 4d |EnableIt|em(editM|
|000020f0| 65 6e 75 2c 20 69 43 6c | 65 61 72 29 3b 0d 09 20 |enu, iCl|ear);.. |
|00002100| 20 7d 0d 09 65 6c 73 65 | 0d 09 20 20 7b 0d 09 09 | }..else|.. {...|
|00002110| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 65 64 69 74 |DisableI|tem(edit|
|00002120| 4d 65 6e 75 2c 20 69 43 | 75 74 29 3b 0d 09 09 44 |Menu, iC|ut);...D|
|00002130| 69 73 61 62 6c 65 49 74 | 65 6d 28 65 64 69 74 4d |isableIt|em(editM|
|00002140| 65 6e 75 2c 20 69 43 6f | 70 79 29 3b 0d 09 09 44 |enu, iCo|py);...D|
|00002150| 69 73 61 62 6c 65 49 74 | 65 6d 28 65 64 69 74 4d |isableIt|em(editM|
|00002160| 65 6e 75 2c 20 69 43 6c | 65 61 72 29 3b 0d 09 20 |enu, iCl|ear);.. |
|00002170| 20 7d 0d 09 69 66 20 28 | 70 61 73 74 65 29 0d 09 | }..if (|paste)..|
|00002180| 20 20 45 6e 61 62 6c 65 | 49 74 65 6d 28 65 64 69 | Enable|Item(edi|
|00002190| 74 4d 65 6e 75 2c 20 69 | 50 61 73 74 65 29 3b 0d |tMenu, i|Paste);.|
|000021a0| 09 65 6c 73 65 20 44 69 | 73 61 62 6c 65 49 74 65 |.else Di|sableIte|
|000021b0| 6d 28 65 64 69 74 4d 65 | 6e 75 2c 20 69 50 61 73 |m(editMe|nu, iPas|
|000021c0| 74 65 29 3b 0d 09 69 66 | 20 28 73 65 6c 65 63 74 |te);..if| (select|
|000021d0| 41 6c 6c 29 0d 09 20 20 | 45 6e 61 62 6c 65 49 74 |All).. |EnableIt|
|000021e0| 65 6d 28 65 64 69 74 4d | 65 6e 75 2c 20 69 53 65 |em(editM|enu, iSe|
|000021f0| 6c 65 63 74 41 6c 6c 29 | 3b 0d 09 65 6c 73 65 20 |lectAll)|;..else |
|00002200| 44 69 73 61 62 6c 65 49 | 74 65 6d 28 65 64 69 74 |DisableI|tem(edit|
|00002210| 4d 65 6e 75 2c 20 69 53 | 65 6c 65 63 74 41 6c 6c |Menu, iS|electAll|
|00002220| 29 3b 0d 0d 09 4d 65 6e | 75 48 61 6e 64 6c 65 09 |);...Men|uHandle.|
|00002230| 66 6f 6e 74 4d 65 6e 75 | 2c 20 66 6f 6e 74 53 69 |fontMenu|, fontSi|
|00002240| 7a 65 4d 65 6e 75 2c 20 | 73 74 79 6c 65 4d 65 6e |zeMenu, |styleMen|
|00002250| 75 3b 0d 09 66 6f 6e 74 | 4d 65 6e 75 20 3d 20 47 |u;..font|Menu = G|
|00002260| 65 74 4d 48 61 6e 64 6c | 65 28 6d 46 6f 6e 74 29 |etMHandl|e(mFont)|
|00002270| 3b 0d 09 66 6f 6e 74 53 | 69 7a 65 4d 65 6e 75 20 |;..fontS|izeMenu |
|00002280| 3d 20 47 65 74 4d 48 61 | 6e 64 6c 65 28 6d 46 6f |= GetMHa|ndle(mFo|
|00002290| 6e 74 53 69 7a 65 29 3b | 0d 09 73 74 79 6c 65 4d |ntSize);|..styleM|
|000022a0| 65 6e 75 20 3d 20 47 65 | 74 4d 48 61 6e 64 6c 65 |enu = Ge|tMHandle|
|000022b0| 28 6d 53 74 79 6c 65 29 | 3b 0d 09 69 66 20 28 66 |(mStyle)|;..if (f|
|000022c0| 72 6f 6e 74 6d 6f 73 74 | 20 3d 3d 20 28 57 69 6e |rontmost| == (Win|
|000022d0| 64 6f 77 50 74 72 29 20 | 6e 69 6c 29 09 2f 2f 20 |dowPtr) |nil).// |
|000022e0| 74 68 65 20 d2 66 6f 6e | 74 d3 20 6d 65 6e 75 73 |the .fon|t. menus|
|000022f0| 20 61 72 65 20 64 69 73 | 61 62 6c 65 64 20 69 66 | are dis|abled if|
|00002300| 20 74 68 65 72 65 20 69 | 73 20 6e 6f 20 64 6f 63 | there i|s no doc|
|00002310| 0d 09 20 20 7b 0d 09 20 | 20 20 20 44 69 73 61 62 |.. {.. | Disab|
|00002320| 6c 65 49 74 65 6d 28 66 | 6f 6e 74 4d 65 6e 75 2c |leItem(f|ontMenu,|
|00002330| 20 30 29 3b 0d 09 20 20 | 20 20 44 69 73 61 62 6c | 0);.. | Disabl|
|00002340| 65 49 74 65 6d 28 66 6f | 6e 74 53 69 7a 65 4d 65 |eItem(fo|ntSizeMe|
|00002350| 6e 75 2c 20 30 29 3b 0d | 09 20 20 20 20 44 69 73 |nu, 0);.|. Dis|
|00002360| 61 62 6c 65 49 74 65 6d | 28 73 74 79 6c 65 4d 65 |ableItem|(styleMe|
|00002370| 6e 75 2c 20 30 29 3b 0d | 09 20 20 7d 0d 09 65 6c |nu, 0);.|. }..el|
|00002380| 73 65 0d 09 20 20 7b 0d | 09 20 20 20 20 45 6e 61 |se.. {.|. Ena|
|00002390| 62 6c 65 49 74 65 6d 28 | 66 6f 6e 74 4d 65 6e 75 |bleItem(|fontMenu|
|000023a0| 2c 20 30 29 3b 0d 09 20 | 20 20 20 45 6e 61 62 6c |, 0);.. | Enabl|
|000023b0| 65 49 74 65 6d 28 66 6f | 6e 74 53 69 7a 65 4d 65 |eItem(fo|ntSizeMe|
|000023c0| 6e 75 2c 20 30 29 3b 0d | 09 20 20 20 20 45 6e 61 |nu, 0);.|. Ena|
|000023d0| 62 6c 65 49 74 65 6d 28 | 73 74 79 6c 65 4d 65 6e |bleItem(|styleMen|
|000023e0| 75 2c 20 30 29 3b 0d 0d | 09 09 73 68 6f 72 74 09 |u, 0);..|..short.|
|000023f0| 66 6f 6e 74 53 69 7a 65 | 20 3d 20 66 54 45 43 75 |fontSize| = fTECu|
|00002400| 72 44 6f 63 2d 3e 47 65 | 74 53 65 6c 65 63 74 69 |rDoc->Ge|tSelecti|
|00002410| 6f 6e 46 6f 6e 74 53 69 | 7a 65 28 29 3b 0d 09 09 |onFontSi|ze();...|
|00002420| 43 68 65 63 6b 49 74 65 | 6d 28 66 6f 6e 74 53 69 |CheckIte|m(fontSi|
|00002430| 7a 65 4d 65 6e 75 2c 20 | 69 39 50 6f 69 6e 74 2c |zeMenu, |i9Point,|
|00002440| 20 66 6f 6e 74 53 69 7a | 65 20 3d 3d 20 39 29 3b | fontSiz|e == 9);|
|00002450| 0d 09 09 43 68 65 63 6b | 49 74 65 6d 28 66 6f 6e |...Check|Item(fon|
|00002460| 74 53 69 7a 65 4d 65 6e | 75 2c 20 69 31 30 50 6f |tSizeMen|u, i10Po|
|00002470| 69 6e 74 2c 20 66 6f 6e | 74 53 69 7a 65 20 3d 3d |int, fon|tSize ==|
|00002480| 20 31 30 29 3b 0d 09 09 | 43 68 65 63 6b 49 74 65 | 10);...|CheckIte|
|00002490| 6d 28 66 6f 6e 74 53 69 | 7a 65 4d 65 6e 75 2c 20 |m(fontSi|zeMenu, |
|000024a0| 69 31 32 50 6f 69 6e 74 | 2c 20 66 6f 6e 74 53 69 |i12Point|, fontSi|
|000024b0| 7a 65 20 3d 3d 20 31 32 | 29 3b 0d 09 09 43 68 65 |ze == 12|);...Che|
|000024c0| 63 6b 49 74 65 6d 28 66 | 6f 6e 74 53 69 7a 65 4d |ckItem(f|ontSizeM|
|000024d0| 65 6e 75 2c 20 69 31 34 | 50 6f 69 6e 74 2c 20 66 |enu, i14|Point, f|
|000024e0| 6f 6e 74 53 69 7a 65 20 | 3d 3d 20 31 34 29 3b 0d |ontSize |== 14);.|
|000024f0| 09 09 43 68 65 63 6b 49 | 74 65 6d 28 66 6f 6e 74 |..CheckI|tem(font|
|00002500| 53 69 7a 65 4d 65 6e 75 | 2c 20 69 31 38 50 6f 69 |SizeMenu|, i18Poi|
|00002510| 6e 74 2c 20 66 6f 6e 74 | 53 69 7a 65 20 3d 3d 20 |nt, font|Size == |
|00002520| 31 38 29 3b 0d 09 09 43 | 68 65 63 6b 49 74 65 6d |18);...C|heckItem|
|00002530| 28 66 6f 6e 74 53 69 7a | 65 4d 65 6e 75 2c 20 69 |(fontSiz|eMenu, i|
|00002540| 32 34 50 6f 69 6e 74 2c | 20 66 6f 6e 74 53 69 7a |24Point,| fontSiz|
|00002550| 65 20 3d 3d 20 32 34 29 | 3b 0d 0d 09 09 73 68 6f |e == 24)|;....sho|
|00002560| 72 74 09 66 6f 6e 74 49 | 44 20 3d 20 66 54 45 43 |rt.fontI|D = fTEC|
|00002570| 75 72 44 6f 63 2d 3e 47 | 65 74 53 65 6c 65 63 74 |urDoc->G|etSelect|
|00002580| 69 6f 6e 46 6f 6e 74 28 | 29 3b 0d 09 09 73 68 6f |ionFont(|);...sho|
|00002590| 72 74 09 6e 46 6f 6e 74 | 73 20 3d 20 43 6f 75 6e |rt.nFont|s = Coun|
|000025a0| 74 4d 49 74 65 6d 73 28 | 66 6f 6e 74 4d 65 6e 75 |tMItems(|fontMenu|
|000025b0| 29 3b 0d 09 09 73 68 6f | 72 74 09 69 3b 0d 09 09 |);...sho|rt.i;...|
|000025c0| 66 6f 72 20 28 69 20 3d | 20 31 3b 20 69 20 3c 3d |for (i =| 1; i <=|
|000025d0| 20 6e 46 6f 6e 74 73 3b | 20 69 2b 2b 29 0d 09 09 | nFonts;| i++)...|
|000025e0| 09 43 68 65 63 6b 49 74 | 65 6d 28 66 6f 6e 74 4d |.CheckIt|em(fontM|
|000025f0| 65 6e 75 2c 20 69 2c 20 | 66 61 6c 73 65 29 3b 0d |enu, i, |false);.|
|00002600| 09 09 66 6f 72 20 28 69 | 20 3d 20 31 3b 20 69 20 |..for (i| = 1; i |
|00002610| 3c 3d 20 6e 46 6f 6e 74 | 73 3b 20 69 2b 2b 29 0d |<= nFont|s; i++).|
|00002620| 09 09 7b 0d 09 09 09 53 | 74 72 32 35 35 09 66 6f |..{....S|tr255.fo|
|00002630| 6e 74 4e 61 6d 65 3b 0d | 09 09 09 73 68 6f 72 74 |ntName;.|...short|
|00002640| 09 61 46 6f 6e 74 49 44 | 3b 0d 09 09 09 47 65 74 |.aFontID|;....Get|
|00002650| 49 74 65 6d 28 66 6f 6e | 74 4d 65 6e 75 2c 20 69 |Item(fon|tMenu, i|
|00002660| 2c 20 66 6f 6e 74 4e 61 | 6d 65 29 3b 0d 09 09 09 |, fontNa|me);....|
|00002670| 47 65 74 46 4e 75 6d 28 | 66 6f 6e 74 4e 61 6d 65 |GetFNum(|fontName|
|00002680| 2c 20 26 61 46 6f 6e 74 | 49 44 29 3b 0d 09 09 09 |, &aFont|ID);....|
|00002690| 69 66 20 28 61 46 6f 6e | 74 49 44 20 3d 3d 20 66 |if (aFon|tID == f|
|000026a0| 6f 6e 74 49 44 29 0d 09 | 09 09 7b 0d 09 09 09 09 |ontID)..|..{.....|
|000026b0| 43 68 65 63 6b 49 74 65 | 6d 28 66 6f 6e 74 4d 65 |CheckIte|m(fontMe|
|000026c0| 6e 75 2c 20 69 2c 20 74 | 72 75 65 29 3b 0d 09 09 |nu, i, t|rue);...|
|000026d0| 09 09 62 72 65 61 6b 3b | 0d 09 09 09 7d 0d 09 09 |..break;|....}...|
|000026e0| 7d 0d 0d 09 09 43 68 65 | 63 6b 49 74 65 6d 28 73 |}....Che|ckItem(s|
|000026f0| 74 79 6c 65 4d 65 6e 75 | 2c 20 69 50 6c 61 69 6e |tyleMenu|, iPlain|
|00002700| 2c 20 66 54 45 43 75 72 | 44 6f 63 2d 3e 53 65 6c |, fTECur|Doc->Sel|
|00002710| 65 63 74 69 6f 6e 49 73 | 50 6c 61 69 6e 28 29 29 |ectionIs|Plain())|
|00002720| 3b 0d 09 09 43 68 65 63 | 6b 49 74 65 6d 28 73 74 |;...Chec|kItem(st|
|00002730| 79 6c 65 4d 65 6e 75 2c | 20 69 42 6f 6c 64 2c 20 |yleMenu,| iBold, |
|00002740| 66 54 45 43 75 72 44 6f | 63 2d 3e 53 65 6c 65 63 |fTECurDo|c->Selec|
|00002750| 74 69 6f 6e 49 73 42 6f | 6c 64 28 29 29 3b 0d 09 |tionIsBo|ld());..|
|00002760| 09 43 68 65 63 6b 49 74 | 65 6d 28 73 74 79 6c 65 |.CheckIt|em(style|
|00002770| 4d 65 6e 75 2c 20 69 49 | 74 61 6c 69 63 2c 20 66 |Menu, iI|talic, f|
|00002780| 54 45 43 75 72 44 6f 63 | 2d 3e 53 65 6c 65 63 74 |TECurDoc|->Select|
|00002790| 69 6f 6e 49 73 49 74 61 | 6c 69 63 28 29 29 3b 0d |ionIsIta|lic());.|
|000027a0| 09 09 43 68 65 63 6b 49 | 74 65 6d 28 73 74 79 6c |..CheckI|tem(styl|
|000027b0| 65 4d 65 6e 75 2c 20 69 | 55 6e 64 65 72 6c 69 6e |eMenu, i|Underlin|
|000027c0| 65 2c 20 66 54 45 43 75 | 72 44 6f 63 2d 3e 53 65 |e, fTECu|rDoc->Se|
|000027d0| 6c 65 63 74 69 6f 6e 49 | 73 55 6e 64 65 72 6c 69 |lectionI|sUnderli|
|000027e0| 6e 65 28 29 29 3b 0d 09 | 09 43 68 65 63 6b 49 74 |ne());..|.CheckIt|
|000027f0| 65 6d 28 73 74 79 6c 65 | 4d 65 6e 75 2c 20 69 4f |em(style|Menu, iO|
|00002800| 75 74 6c 69 6e 65 2c 20 | 66 54 45 43 75 72 44 6f |utline, |fTECurDo|
|00002810| 63 2d 3e 53 65 6c 65 63 | 74 69 6f 6e 49 73 4f 75 |c->Selec|tionIsOu|
|00002820| 74 6c 69 6e 65 28 29 29 | 3b 0d 09 09 43 68 65 63 |tline())|;...Chec|
|00002830| 6b 49 74 65 6d 28 73 74 | 79 6c 65 4d 65 6e 75 2c |kItem(st|yleMenu,|
|00002840| 20 69 53 68 61 64 6f 77 | 2c 20 66 54 45 43 75 72 | iShadow|, fTECur|
|00002850| 44 6f 63 2d 3e 53 65 6c | 65 63 74 69 6f 6e 49 73 |Doc->Sel|ectionIs|
|00002860| 53 68 61 64 6f 77 28 29 | 29 3b 0d 09 20 20 7d 0d |Shadow()|);.. }.|
|00002870| 0d 7d 20 2f 2f 20 41 64 | 6a 75 73 74 4d 65 6e 75 |.} // Ad|justMenu|
|00002880| 73 0d 0d 0d 2f 2f 20 54 | 68 69 73 20 69 73 20 63 |s...// T|his is c|
|00002890| 61 6c 6c 65 64 20 77 68 | 65 6e 20 61 6e 20 69 74 |alled wh|en an it|
|000028a0| 65 6d 20 69 73 20 63 68 | 6f 73 65 6e 20 66 72 6f |em is ch|osen fro|
|000028b0| 6d 20 74 68 65 20 6d 65 | 6e 75 20 62 61 72 20 28 |m the me|nu bar (|
|000028c0| 61 66 74 65 72 20 63 61 | 6c 6c 69 6e 67 0d 2f 2f |after ca|lling.//|
|000028d0| 20 4d 65 6e 75 53 65 6c | 65 63 74 20 6f 72 20 4d | MenuSel|ect or M|
|000028e0| 65 6e 75 4b 65 79 29 2e | 20 49 74 20 64 6f 65 73 |enuKey).| It does|
|000028f0| 20 74 68 65 20 72 69 67 | 68 74 20 74 68 69 6e 67 | the rig|ht thing|
|00002900| 20 66 6f 72 20 65 61 63 | 68 20 63 6f 6d 6d 61 6e | for eac|h comman|
|00002910| 64 2e 0d 0d 76 6f 69 64 | 20 54 45 53 61 6d 70 6c |d...void| TESampl|
|00002920| 65 3a 3a 44 6f 4d 65 6e | 75 43 6f 6d 6d 61 6e 64 |e::DoMen|uCommand|
|00002930| 28 73 68 6f 72 74 20 6d | 65 6e 75 49 44 2c 20 73 |(short m|enuID, s|
|00002940| 68 6f 72 74 20 6d 65 6e | 75 49 74 65 6d 29 0d 7b |hort men|uItem).{|
|00002950| 0d 09 73 68 6f 72 74 09 | 09 69 74 65 6d 48 69 74 |..short.|.itemHit|
|00002960| 3b 0d 09 73 68 6f 72 74 | 09 09 66 6f 6e 74 53 69 |;..short|..fontSi|
|00002970| 7a 65 3b 0d 09 53 74 72 | 32 35 35 09 09 66 6f 6e |ze;..Str|255..fon|
|00002980| 74 4e 61 6d 65 3b 0d 09 | 53 74 72 32 35 35 09 09 |tName;..|Str255..|
|00002990| 64 61 4e 61 6d 65 3b 0d | 09 73 68 6f 72 74 09 09 |daName;.|.short..|
|000029a0| 64 61 52 65 66 4e 75 6d | 3b 0d 09 57 69 6e 64 6f |daRefNum|;..Windo|
|000029b0| 77 50 74 72 09 77 69 6e | 64 6f 77 3b 0d 09 54 45 |wPtr.win|dow;..TE|
|000029c0| 44 6f 63 75 6d 65 6e 74 | 2a 20 66 54 45 43 75 72 |Document|* fTECur|
|000029d0| 44 6f 63 20 3d 20 28 54 | 45 44 6f 63 75 6d 65 6e |Doc = (T|EDocumen|
|000029e0| 74 2a 29 20 66 43 75 72 | 44 6f 63 3b 0d 0d 09 77 |t*) fCur|Doc;...w|
|000029f0| 69 6e 64 6f 77 20 3d 20 | 46 72 6f 6e 74 57 69 6e |indow = |FrontWin|
|00002a00| 64 6f 77 28 29 3b 0d 09 | 73 77 69 74 63 68 20 28 |dow();..|switch (|
|00002a10| 20 6d 65 6e 75 49 44 20 | 29 0d 09 20 20 7b 0d 09 | menuID |).. {..|
|00002a20| 09 63 61 73 65 20 6d 41 | 70 70 6c 65 3a 0d 09 09 |.case mA|pple:...|
|00002a30| 09 73 77 69 74 63 68 20 | 28 20 6d 65 6e 75 49 74 |.switch |( menuIt|
|00002a40| 65 6d 20 29 0d 09 09 09 | 20 20 7b 0d 09 09 09 09 |em )....| {.....|
|00002a50| 63 61 73 65 20 69 41 62 | 6f 75 74 3a 09 09 2f 2f |case iAb|out:..//|
|00002a60| 20 62 72 69 6e 67 20 75 | 70 20 61 6c 65 72 74 20 | bring u|p alert |
|00002a70| 66 6f 72 20 41 62 6f 75 | 74 0d 09 09 09 09 09 69 |for Abou|t......i|
|00002a80| 74 65 6d 48 69 74 20 3d | 20 41 6c 65 72 74 28 72 |temHit =| Alert(r|
|00002a90| 41 62 6f 75 74 41 6c 65 | 72 74 2c 20 6e 69 6c 29 |AboutAle|rt, nil)|
|00002aa0| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|00002ab0| 09 09 64 65 66 61 75 6c | 74 3a 09 09 09 2f 2f 20 |..defaul|t:...// |
|00002ac0| 61 6c 6c 20 6e 6f 6e 2d | 41 62 6f 75 74 20 69 74 |all non-|About it|
|00002ad0| 65 6d 73 20 69 6e 20 74 | 68 69 73 20 6d 65 6e 75 |ems in t|his menu|
|00002ae0| 20 61 72 65 20 44 41 73 | 20 65 74 20 61 6c 0d 09 | are DAs| et al..|
|00002af0| 09 09 09 09 47 65 74 49 | 74 65 6d 28 47 65 74 4d |....GetI|tem(GetM|
|00002b00| 48 61 6e 64 6c 65 28 6d | 41 70 70 6c 65 29 2c 20 |Handle(m|Apple), |
|00002b10| 6d 65 6e 75 49 74 65 6d | 2c 20 64 61 4e 61 6d 65 |menuItem|, daName|
|00002b20| 29 3b 0d 09 09 09 09 09 | 64 61 52 65 66 4e 75 6d |);......|daRefNum|
|00002b30| 20 3d 20 4f 70 65 6e 44 | 65 73 6b 41 63 63 28 64 | = OpenD|eskAcc(d|
|00002b40| 61 4e 61 6d 65 29 3b 0d | 09 09 09 09 09 62 72 65 |aName);.|.....bre|
|00002b50| 61 6b 3b 0d 09 09 09 20 | 20 7d 0d 09 09 09 62 72 |ak;.... | }....br|
|00002b60| 65 61 6b 3b 0d 09 09 63 | 61 73 65 20 6d 46 69 6c |eak;...c|ase mFil|
|00002b70| 65 3a 0d 09 09 09 73 77 | 69 74 63 68 20 28 20 6d |e:....sw|itch ( m|
|00002b80| 65 6e 75 49 74 65 6d 20 | 29 0d 09 09 09 20 20 7b |enuItem |).... {|
|00002b90| 0d 09 09 09 09 63 61 73 | 65 20 69 4e 65 77 3a 0d |.....cas|e iNew:.|
|00002ba0| 09 09 09 09 09 44 6f 4e | 65 77 28 29 3b 0d 09 09 |.....DoN|ew();...|
|00002bb0| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 63 61 |...break|;.....ca|
|00002bc0| 73 65 20 69 4f 70 65 6e | 3a 0d 09 09 09 09 09 44 |se iOpen|:......D|
|00002bd0| 6f 4f 70 65 6e 28 29 3b | 0d 09 09 09 09 09 62 72 |oOpen();|......br|
|00002be0| 65 61 6b 3b 0d 09 09 09 | 09 63 61 73 65 20 69 43 |eak;....|.case iC|
|00002bf0| 6c 6f 73 65 3a 0d 09 09 | 09 09 09 69 66 20 28 66 |lose:...|...if (f|
|00002c00| 54 45 43 75 72 44 6f 63 | 20 21 3d 20 6e 69 6c 29 |TECurDoc| != nil)|
|00002c10| 0d 09 09 09 09 09 20 20 | 7b 0d 09 09 09 09 09 09 |...... |{.......|
|00002c20| 2f 2f 20 6f 6e 6c 79 20 | 63 6c 6f 73 65 20 74 68 |// only |close th|
|00002c30| 65 20 64 6f 63 75 6d 65 | 6e 74 20 69 66 20 74 68 |e docume|nt if th|
|00002c40| 65 20 75 73 65 72 20 64 | 6f 65 73 6e 27 74 20 63 |e user d|oesn't c|
|00002c50| 61 6e 63 65 6c 0d 09 09 | 09 09 09 09 69 66 20 28 |ancel...|....if (|
|00002c60| 66 54 45 43 75 72 44 6f | 63 2d 3e 44 6f 43 6c 6f |fTECurDo|c->DoClo|
|00002c70| 73 65 28 74 72 75 65 2c | 20 79 65 73 52 65 73 75 |se(true,| yesResu|
|00002c80| 6c 74 2c 20 66 61 6c 73 | 65 29 20 21 3d 20 63 61 |lt, fals|e) != ca|
|00002c90| 6e 63 65 6c 52 65 73 75 | 6c 74 29 0d 09 09 09 09 |ncelResu|lt).....|
|00002ca0| 09 09 20 20 7b 0d 09 09 | 09 09 09 09 09 66 44 6f |.. {...|.....fDo|
|00002cb0| 63 4c 69 73 74 2d 3e 52 | 65 6d 6f 76 65 44 6f 63 |cList->R|emoveDoc|
|00002cc0| 28 66 54 45 43 75 72 44 | 6f 63 29 3b 0d 09 09 09 |(fTECurD|oc);....|
|00002cd0| 09 09 09 09 64 65 6c 65 | 74 65 20 66 54 45 43 75 |....dele|te fTECu|
|00002ce0| 72 44 6f 63 3b 0d 09 09 | 09 09 09 09 20 20 7d 0d |rDoc;...|.... }.|
|00002cf0| 09 09 09 09 09 20 20 7d | 0d 09 09 09 09 09 65 6c |..... }|......el|
|00002d00| 73 65 20 43 6c 6f 73 65 | 44 65 73 6b 41 63 63 28 |se Close|DeskAcc(|
|00002d10| 28 28 57 69 6e 64 6f 77 | 50 65 65 6b 29 20 66 57 |((Window|Peek) fW|
|00002d20| 68 69 63 68 57 69 6e 64 | 6f 77 29 2d 3e 77 69 6e |hichWind|ow)->win|
|00002d30| 64 6f 77 4b 69 6e 64 29 | 3b 0d 09 09 09 09 09 2f |dowKind)|;....../|
|00002d40| 2f 20 6d 61 6b 65 20 73 | 75 72 65 20 6f 75 72 20 |/ make s|ure our |
|00002d50| 63 75 72 72 65 6e 74 20 | 64 6f 63 75 6d 65 6e 74 |current |document|
|00002d60| 2f 77 69 6e 64 6f 77 20 | 72 65 66 65 72 65 6e 63 |/window |referenc|
|00002d70| 65 73 20 61 72 65 20 76 | 61 6c 69 64 0d 09 09 09 |es are v|alid....|
|00002d80| 09 09 66 57 68 69 63 68 | 57 69 6e 64 6f 77 20 3d |..fWhich|Window =|
|00002d90| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 28 29 3b 0d | FrontWi|ndow();.|
|00002da0| 09 09 09 09 09 69 66 20 | 28 66 57 68 69 63 68 57 |.....if |(fWhichW|
|00002db0| 69 6e 64 6f 77 20 21 3d | 20 6e 69 6c 29 0d 09 09 |indow !=| nil)...|
|00002dc0| 09 09 09 20 20 7b 0d 09 | 09 09 09 09 09 66 43 75 |... {..|.....fCu|
|00002dd0| 72 44 6f 63 20 3d 20 66 | 44 6f 63 4c 69 73 74 2d |rDoc = f|DocList-|
|00002de0| 3e 46 69 6e 64 44 6f 63 | 28 66 57 68 69 63 68 57 |>FindDoc|(fWhichW|
|00002df0| 69 6e 64 6f 77 29 3b 0d | 09 09 09 09 09 09 53 65 |indow);.|......Se|
|00002e00| 74 50 6f 72 74 28 66 57 | 68 69 63 68 57 69 6e 64 |tPort(fW|hichWind|
|00002e10| 6f 77 29 3b 0d 09 09 09 | 09 09 20 20 7d 0d 09 09 |ow);....|.. }...|
|00002e20| 09 09 09 65 6c 73 65 20 | 66 43 75 72 44 6f 63 20 |...else |fCurDoc |
|00002e30| 3d 20 6e 69 6c 3b 0d 09 | 09 09 09 09 62 72 65 61 |= nil;..|....brea|
|00002e40| 6b 3b 0d 09 09 09 09 63 | 61 73 65 20 69 53 61 76 |k;.....c|ase iSav|
|00002e50| 65 3a 0d 09 09 09 09 09 | 69 66 20 28 66 54 45 43 |e:......|if (fTEC|
|00002e60| 75 72 44 6f 63 20 21 3d | 20 6e 69 6c 29 0d 09 09 |urDoc !=| nil)...|
|00002e70| 09 09 09 20 20 66 54 45 | 43 75 72 44 6f 63 2d 3e |... fTE|CurDoc->|
|00002e80| 44 6f 53 61 76 65 28 29 | 3b 0d 09 09 09 09 09 62 |DoSave()|;......b|
|00002e90| 72 65 61 6b 3b 0d 09 09 | 09 09 63 61 73 65 20 69 |reak;...|..case i|
|00002ea0| 53 61 76 65 41 73 3a 0d | 09 09 09 09 09 69 66 20 |SaveAs:.|.....if |
|00002eb0| 28 66 54 45 43 75 72 44 | 6f 63 20 21 3d 20 6e 69 |(fTECurD|oc != ni|
|00002ec0| 6c 29 0d 09 09 09 09 09 | 20 20 66 54 45 43 75 72 |l)......| fTECur|
|00002ed0| 44 6f 63 2d 3e 44 6f 53 | 61 76 65 41 73 28 29 3b |Doc->DoS|aveAs();|
|00002ee0| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00002ef0| 09 63 61 73 65 20 69 51 | 75 69 74 3a 0d 09 09 09 |.case iQ|uit:....|
|00002f00| 09 09 44 6f 51 75 69 74 | 28 74 72 75 65 2c 20 79 |..DoQuit|(true, y|
|00002f10| 65 73 52 65 73 75 6c 74 | 29 3b 0d 09 09 09 09 09 |esResult|);......|
|00002f20| 62 72 65 61 6b 3b 0d 09 | 09 09 20 20 7d 0d 09 09 |break;..|.. }...|
|00002f30| 09 62 72 65 61 6b 3b 0d | 09 09 63 61 73 65 20 6d |.break;.|..case m|
|00002f40| 45 64 69 74 3a 09 09 09 | 09 09 2f 2f 20 63 61 6c |Edit:...|..// cal|
|00002f50| 6c 20 53 79 73 74 65 6d | 45 64 69 74 20 66 6f 72 |l System|Edit for|
|00002f60| 20 44 41 20 65 64 69 74 | 69 6e 67 20 26 20 4d 75 | DA edit|ing & Mu|
|00002f70| 6c 74 69 46 69 6e 64 65 | 72 0d 09 09 09 69 66 20 |ltiFinde|r....if |
|00002f80| 28 21 53 79 73 74 65 6d | 45 64 69 74 28 6d 65 6e |(!System|Edit(men|
|00002f90| 75 49 74 65 6d 2d 31 29 | 29 0d 09 09 09 20 20 7b |uItem-1)|).... {|
|00002fa0| 0d 09 09 09 09 73 77 69 | 74 63 68 20 28 6d 65 6e |.....swi|tch (men|
|00002fb0| 75 49 74 65 6d 29 0d 09 | 09 09 09 20 20 7b 0d 09 |uItem)..|... {..|
|00002fc0| 09 09 09 09 63 61 73 65 | 20 69 43 75 74 3a 0d 09 |....case| iCut:..|
|00002fd0| 09 09 09 09 09 66 54 45 | 43 75 72 44 6f 63 2d 3e |.....fTE|CurDoc->|
|00002fe0| 44 6f 43 75 74 28 29 3b | 0d 09 09 09 09 09 09 62 |DoCut();|.......b|
|00002ff0| 72 65 61 6b 3b 0d 09 09 | 09 09 09 63 61 73 65 20 |reak;...|...case |
|00003000| 69 43 6f 70 79 3a 0d 09 | 09 09 09 09 09 66 54 45 |iCopy:..|.....fTE|
|00003010| 43 75 72 44 6f 63 2d 3e | 44 6f 43 6f 70 79 28 29 |CurDoc->|DoCopy()|
|00003020| 3b 0d 09 09 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |;.......|break;..|
|00003030| 09 09 09 09 63 61 73 65 | 20 69 50 61 73 74 65 3a |....case| iPaste:|
|00003040| 0d 09 09 09 09 09 09 66 | 54 45 43 75 72 44 6f 63 |.......f|TECurDoc|
|00003050| 2d 3e 44 6f 50 61 73 74 | 65 28 29 3b 0d 09 09 09 |->DoPast|e();....|
|00003060| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 09 63 |...break|;......c|
|00003070| 61 73 65 20 69 43 6c 65 | 61 72 3a 0d 09 09 09 09 |ase iCle|ar:.....|
|00003080| 09 09 66 54 45 43 75 72 | 44 6f 63 2d 3e 44 6f 43 |..fTECur|Doc->DoC|
|00003090| 6c 65 61 72 28 29 3b 0d | 09 09 09 09 09 09 62 72 |lear();.|......br|
|000030a0| 65 61 6b 3b 0d 09 09 09 | 09 09 63 61 73 65 20 69 |eak;....|..case i|
|000030b0| 53 65 6c 65 63 74 41 6c | 6c 3a 0d 09 09 09 09 09 |SelectAl|l:......|
|000030c0| 09 66 54 45 43 75 72 44 | 6f 63 2d 3e 44 6f 53 65 |.fTECurD|oc->DoSe|
|000030d0| 6c 65 63 74 41 6c 6c 28 | 29 3b 0d 09 09 09 09 09 |lectAll(|);......|
|000030e0| 09 62 72 65 61 6b 3b 0d | 09 09 09 09 20 20 20 7d |.break;.|.... }|
|000030f0| 0d 09 09 09 20 20 7d 0d | 09 09 09 62 72 65 61 6b |.... }.|...break|
|00003100| 3b 0d 09 09 63 61 73 65 | 20 6d 46 6f 6e 74 3a 0d |;...case| mFont:.|
|00003110| 09 09 09 47 65 74 49 74 | 65 6d 28 47 65 74 4d 48 |...GetIt|em(GetMH|
|00003120| 61 6e 64 6c 65 28 6d 46 | 6f 6e 74 29 2c 20 6d 65 |andle(mF|ont), me|
|00003130| 6e 75 49 74 65 6d 2c 20 | 66 6f 6e 74 4e 61 6d 65 |nuItem, |fontName|
|00003140| 29 3b 0d 09 09 09 66 54 | 45 43 75 72 44 6f 63 2d |);....fT|ECurDoc-|
|00003150| 3e 53 65 74 46 6f 6e 74 | 4e 61 6d 65 28 66 6f 6e |>SetFont|Name(fon|
|00003160| 74 4e 61 6d 65 29 3b 0d | 09 09 09 62 72 65 61 6b |tName);.|...break|
|00003170| 3b 0d 09 09 63 61 73 65 | 20 6d 46 6f 6e 74 53 69 |;...case| mFontSi|
|00003180| 7a 65 3a 0d 09 09 09 73 | 77 69 74 63 68 20 28 6d |ze:....s|witch (m|
|00003190| 65 6e 75 49 74 65 6d 29 | 0d 09 09 09 20 20 7b 0d |enuItem)|.... {.|
|000031a0| 09 09 09 20 20 20 20 63 | 61 73 65 20 69 39 50 6f |... c|ase i9Po|
|000031b0| 69 6e 74 3a 0d 09 09 09 | 09 09 66 6f 6e 74 53 69 |int:....|..fontSi|
|000031c0| 7a 65 20 3d 20 39 3b 0d | 09 09 09 09 09 62 72 65 |ze = 9;.|.....bre|
|000031d0| 61 6b 3b 0d 09 09 09 09 | 63 61 73 65 20 69 31 30 |ak;.....|case i10|
|000031e0| 50 6f 69 6e 74 3a 0d 09 | 09 09 09 09 66 6f 6e 74 |Point:..|....font|
|000031f0| 53 69 7a 65 20 3d 20 31 | 30 3b 0d 09 09 09 09 09 |Size = 1|0;......|
|00003200| 62 72 65 61 6b 3b 0d 09 | 09 09 09 63 61 73 65 20 |break;..|...case |
|00003210| 69 31 32 50 6f 69 6e 74 | 3a 0d 09 09 09 09 09 66 |i12Point|:......f|
|00003220| 6f 6e 74 53 69 7a 65 20 | 3d 20 31 32 3b 0d 09 09 |ontSize |= 12;...|
|00003230| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 09 63 61 |...break|;.....ca|
|00003240| 73 65 20 69 31 34 50 6f | 69 6e 74 3a 0d 09 09 09 |se i14Po|int:....|
|00003250| 09 09 66 6f 6e 74 53 69 | 7a 65 20 3d 20 31 34 3b |..fontSi|ze = 14;|
|00003260| 0d 09 09 09 09 09 62 72 | 65 61 6b 3b 0d 09 09 09 |......br|eak;....|
|00003270| 09 63 61 73 65 20 69 31 | 38 50 6f 69 6e 74 3a 0d |.case i1|8Point:.|
|00003280| 09 09 09 09 09 66 6f 6e | 74 53 69 7a 65 20 3d 20 |.....fon|tSize = |
|00003290| 31 38 3b 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |18;.....|.break;.|
|000032a0| 09 09 09 09 63 61 73 65 | 20 69 32 34 50 6f 69 6e |....case| i24Poin|
|000032b0| 74 3a 0d 09 09 09 09 09 | 66 6f 6e 74 53 69 7a 65 |t:......|fontSize|
|000032c0| 20 3d 20 32 34 3b 0d 09 | 09 09 09 09 62 72 65 61 | = 24;..|....brea|
|000032d0| 6b 3b 0d 09 09 09 20 20 | 7d 0d 09 09 09 66 54 45 |k;.... |}....fTE|
|000032e0| 43 75 72 44 6f 63 2d 3e | 53 65 74 46 6f 6e 74 53 |CurDoc->|SetFontS|
|000032f0| 69 7a 65 28 66 6f 6e 74 | 53 69 7a 65 29 3b 0d 09 |ize(font|Size);..|
|00003300| 09 09 62 72 65 61 6b 3b | 0d 09 09 63 61 73 65 20 |..break;|...case |
|00003310| 6d 53 74 79 6c 65 3a 0d | 09 09 09 73 77 69 74 63 |mStyle:.|...switc|
|00003320| 68 20 28 6d 65 6e 75 49 | 74 65 6d 29 0d 09 09 09 |h (menuI|tem)....|
|00003330| 20 20 7b 0d 09 09 09 20 | 20 20 20 63 61 73 65 20 | {.... | case |
|00003340| 69 50 6c 61 69 6e 3a 0d | 09 09 09 09 09 66 54 45 |iPlain:.|.....fTE|
|00003350| 43 75 72 44 6f 63 2d 3e | 53 65 74 50 6c 61 69 6e |CurDoc->|SetPlain|
|00003360| 28 29 3b 0d 09 09 09 09 | 09 62 72 65 61 6b 3b 0d |();.....|.break;.|
|00003370| 09 09 09 09 63 61 73 65 | 20 69 42 6f 6c 64 3a 0d |....case| iBold:.|
|00003380| 09 09 09 09 09 66 54 45 | 43 75 72 44 6f 63 2d 3e |.....fTE|CurDoc->|
|00003390| 53 65 74 42 6f 6c 64 28 | 21 66 54 45 43 75 72 44 |SetBold(|!fTECurD|
|000033a0| 6f 63 2d 3e 53 65 6c 65 | 63 74 69 6f 6e 49 73 42 |oc->Sele|ctionIsB|
|000033b0| 6f 6c 64 28 29 29 3b 0d | 09 09 09 09 09 62 72 65 |old());.|.....bre|
|000033c0| 61 6b 3b 0d 09 09 09 09 | 63 61 73 65 20 69 49 74 |ak;.....|case iIt|
|000033d0| 61 6c 69 63 3a 0d 09 09 | 09 09 09 66 54 45 43 75 |alic:...|...fTECu|
|000033e0| 72 44 6f 63 2d 3e 53 65 | 74 49 74 61 6c 69 63 28 |rDoc->Se|tItalic(|
|000033f0| 21 66 54 45 43 75 72 44 | 6f 63 2d 3e 53 65 6c 65 |!fTECurD|oc->Sele|
|00003400| 63 74 69 6f 6e 49 73 49 | 74 61 6c 69 63 28 29 29 |ctionIsI|talic())|
|00003410| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|00003420| 09 09 63 61 73 65 20 69 | 55 6e 64 65 72 6c 69 6e |..case i|Underlin|
|00003430| 65 3a 0d 09 09 09 09 09 | 66 54 45 43 75 72 44 6f |e:......|fTECurDo|
|00003440| 63 2d 3e 53 65 74 55 6e | 64 65 72 6c 69 6e 65 28 |c->SetUn|derline(|
|00003450| 21 66 54 45 43 75 72 44 | 6f 63 2d 3e 53 65 6c 65 |!fTECurD|oc->Sele|
|00003460| 63 74 69 6f 6e 49 73 55 | 6e 64 65 72 6c 69 6e 65 |ctionIsU|nderline|
|00003470| 28 29 29 3b 0d 09 09 09 | 09 09 62 72 65 61 6b 3b |());....|..break;|
|00003480| 0d 09 09 09 09 63 61 73 | 65 20 69 4f 75 74 6c 69 |.....cas|e iOutli|
|00003490| 6e 65 3a 0d 09 09 09 09 | 09 66 54 45 43 75 72 44 |ne:.....|.fTECurD|
|000034a0| 6f 63 2d 3e 53 65 74 4f | 75 74 6c 69 6e 65 28 21 |oc->SetO|utline(!|
|000034b0| 66 54 45 43 75 72 44 6f | 63 2d 3e 53 65 6c 65 63 |fTECurDo|c->Selec|
|000034c0| 74 69 6f 6e 49 73 4f 75 | 74 6c 69 6e 65 28 29 29 |tionIsOu|tline())|
|000034d0| 3b 0d 09 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |;......b|reak;...|
|000034e0| 09 09 63 61 73 65 20 69 | 53 68 61 64 6f 77 3a 0d |..case i|Shadow:.|
|000034f0| 09 09 09 09 09 66 54 45 | 43 75 72 44 6f 63 2d 3e |.....fTE|CurDoc->|
|00003500| 53 65 74 53 68 61 64 6f | 77 28 21 66 54 45 43 75 |SetShado|w(!fTECu|
|00003510| 72 44 6f 63 2d 3e 53 65 | 6c 65 63 74 69 6f 6e 49 |rDoc->Se|lectionI|
|00003520| 73 53 68 61 64 6f 77 28 | 29 29 3b 0d 09 09 09 09 |sShadow(|));.....|
|00003530| 09 62 72 65 61 6b 3b 0d | 09 09 09 20 20 7d 0d 09 |.break;.|... }..|
|00003540| 09 09 62 72 65 61 6b 3b | 0d 09 20 20 7d 0d 09 48 |..break;|.. }..H|
|00003550| 69 6c 69 74 65 4d 65 6e | 75 28 30 29 3b 09 09 09 |iliteMen|u(0);...|
|00003560| 09 09 2f 2f 20 75 6e 68 | 69 67 68 6c 69 67 68 74 |..// unh|ighlight|
|00003570| 20 77 68 61 74 20 4d 65 | 6e 75 53 65 6c 65 63 74 | what Me|nuSelect|
|00003580| 20 28 6f 72 20 4d 65 6e | 75 4b 65 79 29 20 68 69 | (or Men|uKey) hi|
|00003590| 6c 69 74 65 64 0d 7d 20 | 2f 2f 20 44 6f 4d 65 6e |lited.} |// DoMen|
|000035a0| 75 43 6f 6d 6d 61 6e 64 | 0d 0d 2f 2f 20 43 72 65 |uCommand|..// Cre|
|000035b0| 61 74 65 20 61 20 6e 65 | 77 20 64 6f 63 75 6d 65 |ate a ne|w docume|
|000035c0| 6e 74 20 61 6e 64 20 77 | 69 6e 64 6f 77 2e 0d 0d |nt and w|indow...|
|000035d0| 76 6f 69 64 20 54 45 53 | 61 6d 70 6c 65 3a 3a 44 |void TES|ample::D|
|000035e0| 6f 4e 65 77 28 29 0d 7b | 0d 09 54 45 44 6f 63 75 |oNew().{|..TEDocu|
|000035f0| 6d 65 6e 74 2a 20 74 44 | 6f 63 3b 0d 0d 09 74 44 |ment* tD|oc;...tD|
|00003600| 6f 63 20 3d 20 6e 65 77 | 20 54 45 44 6f 63 75 6d |oc = new| TEDocum|
|00003610| 65 6e 74 28 72 44 6f 63 | 57 69 6e 64 6f 77 29 3b |ent(rDoc|Window);|
|00003620| 0d 09 46 61 69 6c 4e 49 | 4c 28 74 44 6f 63 29 3b |..FailNI|L(tDoc);|
|00003630| 0d 0d 09 54 52 59 0d 09 | 20 20 7b 0d 09 09 74 44 |...TRY..| {...tD|
|00003640| 6f 63 2d 3e 4f 70 65 6e | 4e 65 77 44 6f 63 28 29 |oc->Open|NewDoc()|
|00003650| 3b 0d 09 09 66 44 6f 63 | 4c 69 73 74 2d 3e 41 64 |;...fDoc|List->Ad|
|00003660| 64 44 6f 63 28 74 44 6f | 63 29 3b 0d 09 20 20 7d |dDoc(tDo|c);.. }|
|00003670| 0d 09 52 45 43 4f 56 45 | 52 0d 09 20 20 7b 0d 09 |..RECOVE|R.. {..|
|00003680| 09 64 65 6c 65 74 65 20 | 74 44 6f 63 3b 0d 09 20 |.delete |tDoc;.. |
|00003690| 20 7d 0d 09 45 4e 44 54 | 52 59 0d 7d 20 2f 2f 20 | }..ENDT|RY.} // |
|000036a0| 44 6f 4e 65 77 0d 0d 76 | 6f 69 64 20 54 45 53 61 |DoNew..v|oid TESa|
|000036b0| 6d 70 6c 65 3a 3a 4f 70 | 65 6e 41 44 6f 63 28 73 |mple::Op|enADoc(s|
|000036c0| 68 6f 72 74 20 76 52 65 | 66 4e 75 6d 2c 20 6c 6f |hort vRe|fNum, lo|
|000036d0| 6e 67 20 64 69 72 49 44 | 2c 20 53 74 72 69 6e 67 |ng dirID|, String|
|000036e0| 50 74 72 20 66 4e 61 6d | 65 2c 20 4f 53 54 79 70 |Ptr fNam|e, OSTyp|
|000036f0| 65 20 66 54 79 70 65 29 | 0d 7b 0d 09 69 66 20 28 |e fType)|.{..if (|
|00003700| 66 54 79 70 65 20 21 3d | 20 6b 54 45 46 69 6c 65 |fType !=| kTEFile|
|00003710| 54 79 70 65 29 0d 09 20 | 20 46 61 69 6c 75 72 65 |Type).. | Failure|
|00003720| 28 65 42 61 64 46 69 6c | 65 54 79 70 65 2c 6b 54 |(eBadFil|eType,kT|
|00003730| 45 44 6f 63 45 72 72 53 | 74 72 69 6e 67 73 29 3b |EDocErrS|trings);|
|00003740| 0d 0d 09 54 45 44 6f 63 | 75 6d 65 6e 74 2a 20 74 |...TEDoc|ument* t|
|00003750| 44 6f 63 20 3d 20 6e 65 | 77 20 54 45 44 6f 63 75 |Doc = ne|w TEDocu|
|00003760| 6d 65 6e 74 28 72 44 6f | 63 57 69 6e 64 6f 77 29 |ment(rDo|cWindow)|
|00003770| 3b 0d 09 46 61 69 6c 4e | 49 4c 28 74 44 6f 63 29 |;..FailN|IL(tDoc)|
|00003780| 3b 0d 0d 09 54 52 59 0d | 09 20 20 7b 0d 09 09 46 |;...TRY.|. {...F|
|00003790| 53 53 70 65 63 20 66 69 | 6c 65 53 70 65 63 3b 0d |SSpec fi|leSpec;.|
|000037a0| 0d 09 09 66 69 6c 65 53 | 70 65 63 2e 76 52 65 66 |...fileS|pec.vRef|
|000037b0| 4e 75 6d 20 3d 20 76 52 | 65 66 4e 75 6d 3b 0d 09 |Num = vR|efNum;..|
|000037c0| 09 66 69 6c 65 53 70 65 | 63 2e 70 61 72 49 44 20 |.fileSpe|c.parID |
|000037d0| 3d 20 64 69 72 49 44 3b | 0d 09 09 43 6f 70 79 50 |= dirID;|...CopyP|
|000037e0| 53 74 72 69 6e 67 28 66 | 69 6c 65 53 70 65 63 2e |String(f|ileSpec.|
|000037f0| 6e 61 6d 65 2c 20 66 4e | 61 6d 65 29 3b 0d 0d 09 |name, fN|ame);...|
|00003800| 09 74 44 6f 63 2d 3e 4f | 70 65 6e 4f 6c 64 44 6f |.tDoc->O|penOldDo|
|00003810| 63 28 66 69 6c 65 53 70 | 65 63 2c 66 61 6c 73 65 |c(fileSp|ec,false|
|00003820| 29 3b 0d 09 09 66 44 6f | 63 4c 69 73 74 2d 3e 41 |);...fDo|cList->A|
|00003830| 64 64 44 6f 63 28 74 44 | 6f 63 29 3b 0d 09 20 20 |ddDoc(tD|oc);.. |
|00003840| 7d 0d 09 52 45 43 4f 56 | 45 52 0d 09 20 20 7b 0d |}..RECOV|ER.. {.|
|00003850| 09 09 64 65 6c 65 74 65 | 20 74 44 6f 63 3b 0d 09 |..delete| tDoc;..|
|00003860| 20 20 7d 0d 09 45 4e 44 | 54 52 59 0d 7d 0d 0d 76 | }..END|TRY.}..v|
|00003870| 6f 69 64 20 54 45 53 61 | 6d 70 6c 65 3a 3a 44 6f |oid TESa|mple::Do|
|00003880| 4f 70 65 6e 28 29 0d 7b | 0d 09 50 6f 69 6e 74 20 |Open().{|..Point |
|00003890| 77 68 65 72 65 3b 0d 09 | 53 74 72 32 35 35 20 70 |where;..|Str255 p|
|000038a0| 72 6f 6d 70 74 3b 0d 09 | 53 46 54 79 70 65 4c 69 |rompt;..|SFTypeLi|
|000038b0| 73 74 20 74 79 70 65 4c | 69 73 74 3b 0d 09 53 46 |st typeL|ist;..SF|
|000038c0| 52 65 70 6c 79 20 72 65 | 70 6c 79 3b 0d 09 73 68 |Reply re|ply;..sh|
|000038d0| 6f 72 74 20 76 52 65 66 | 4e 75 6d 3b 0d 09 6c 6f |ort vRef|Num;..lo|
|000038e0| 6e 67 20 64 69 72 49 44 | 3b 0d 0d 09 53 65 74 50 |ng dirID|;...SetP|
|000038f0| 74 28 26 77 68 65 72 65 | 2c 31 30 30 2c 31 30 30 |t(&where|,100,100|
|00003900| 29 3b 0d 09 70 72 6f 6d | 70 74 5b 30 5d 20 3d 20 |);..prom|pt[0] = |
|00003910| 27 5c 30 27 3b 0d 09 74 | 79 70 65 4c 69 73 74 5b |'\0';..t|ypeList[|
|00003920| 30 5d 20 3d 20 6b 54 45 | 46 69 6c 65 54 79 70 65 |0] = kTE|FileType|
|00003930| 3b 0d 09 53 46 47 65 74 | 46 69 6c 65 28 77 68 65 |;..SFGet|File(whe|
|00003940| 72 65 2c 70 72 6f 6d 70 | 74 2c 28 46 69 6c 65 46 |re,promp|t,(FileF|
|00003950| 69 6c 74 65 72 50 72 6f | 63 50 74 72 29 20 6e 69 |ilterPro|cPtr) ni|
|00003960| 6c 2c 0d 09 09 09 20 20 | 31 2c 74 79 70 65 4c 69 |l,.... |1,typeLi|
|00003970| 73 74 2c 28 44 6c 67 48 | 6f 6f 6b 50 72 6f 63 50 |st,(DlgH|ookProcP|
|00003980| 74 72 29 20 6e 69 6c 2c | 26 72 65 70 6c 79 29 3b |tr) nil,|&reply);|
|00003990| 0d 09 69 66 20 28 72 65 | 70 6c 79 2e 67 6f 6f 64 |..if (re|ply.good|
|000039a0| 20 3d 3d 20 66 61 6c 73 | 65 29 0d 09 20 20 72 65 | == fals|e).. re|
|000039b0| 74 75 72 6e 3b 0d 0d 09 | 57 44 54 6f 44 69 72 49 |turn;...|WDToDirI|
|000039c0| 44 28 72 65 70 6c 79 2e | 76 52 65 66 4e 75 6d 2c |D(reply.|vRefNum,|
|000039d0| 76 52 65 66 4e 75 6d 2c | 64 69 72 49 44 29 3b 0d |vRefNum,|dirID);.|
|000039e0| 09 4f 70 65 6e 41 44 6f | 63 28 76 52 65 66 4e 75 |.OpenADo|c(vRefNu|
|000039f0| 6d 2c 64 69 72 49 44 2c | 72 65 70 6c 79 2e 66 4e |m,dirID,|reply.fN|
|00003a00| 61 6d 65 2c 20 6b 54 45 | 46 69 6c 65 54 79 70 65 |ame, kTE|FileType|
|00003a10| 29 3b 0d 7d 0d 0d 0d 44 | 65 73 63 54 79 70 65 20 |);.}...D|escType |
|00003a20| 54 45 53 61 6d 70 6c 65 | 3a 3a 47 65 74 41 70 70 |TESample|::GetApp|
|00003a30| 6c 65 43 6c 61 73 73 28 | 29 20 63 6f 6e 73 74 0d |leClass(|) const.|
|00003a40| 7b 0d 09 72 65 74 75 72 | 6e 20 74 79 70 65 4e 75 |{..retur|n typeNu|
|00003a50| 6c 6c 3b 0d 7d 0d 0d 0d | 6c 6f 6e 67 20 54 45 53 |ll;.}...|long TES|
|00003a60| 61 6d 70 6c 65 3a 3a 43 | 6f 75 6e 74 43 6f 6e 74 |ample::C|ountCont|
|00003a70| 61 69 6e 65 64 4f 62 6a | 65 63 74 73 28 44 65 73 |ainedObj|ects(Des|
|00003a80| 63 54 79 70 65 20 6f 66 | 54 79 70 65 29 0d 7b 0d |cType of|Type).{.|
|00003a90| 09 6c 6f 6e 67 09 72 65 | 73 75 6c 74 20 3d 20 30 |.long.re|sult = 0|
|00003aa0| 3b 0d 0d 09 73 77 69 74 | 63 68 20 28 6f 66 54 79 |;...swit|ch (ofTy|
|00003ab0| 70 65 29 0d 09 7b 0d 09 | 63 61 73 65 20 63 57 69 |pe)..{..|case cWi|
|00003ac0| 6e 64 6f 77 3a 0d 09 09 | 72 65 73 75 6c 74 20 3d |ndow:...|result =|
|00003ad0| 20 74 68 69 73 2d 3e 44 | 6f 63 4c 69 73 74 28 29 | this->D|ocList()|
|00003ae0| 2d 3e 4e 75 6d 44 6f 63 | 73 28 29 3b 0d 09 09 62 |->NumDoc|s();...b|
|00003af0| 72 65 61 6b 3b 0d 09 7d | 0d 0d 09 2f 2f 20 6e 6f |reak;..}|...// no|
|00003b00| 77 2c 20 61 64 64 20 74 | 68 65 20 6e 75 6d 62 65 |w, add t|he numbe|
|00003b10| 72 20 6f 66 20 6f 62 6a | 65 63 74 73 20 63 6f 6e |r of obj|ects con|
|00003b20| 74 61 69 6e 65 64 20 62 | 79 20 70 61 72 65 6e 74 |tained b|y parent|
|00003b30| 73 0d 09 72 65 73 75 6c | 74 20 2b 3d 20 4d 41 70 |s..resul|t += MAp|
|00003b40| 70 6c 65 4f 62 6a 65 63 | 74 3a 3a 43 6f 75 6e 74 |pleObjec|t::Count|
|00003b50| 43 6f 6e 74 61 69 6e 65 | 64 4f 62 6a 65 63 74 73 |Containe|dObjects|
|00003b60| 28 6f 66 54 79 70 65 29 | 3b 0d 0d 09 72 65 74 75 |(ofType)|;...retu|
|00003b70| 72 6e 20 72 65 73 75 6c | 74 3b 0d 7d 0d 0d 0d 76 |rn resul|t;.}...v|
|00003b80| 6f 69 64 20 54 45 53 61 | 6d 70 6c 65 3a 3a 44 6f |oid TESa|mple::Do|
|00003b90| 41 70 70 6c 65 45 76 65 | 6e 74 28 63 6f 6e 73 74 |AppleEve|nt(const|
|00003ba0| 20 41 70 70 6c 65 45 76 | 65 6e 74 26 20 6d 65 73 | AppleEv|ent& mes|
|00003bb0| 73 61 67 65 2c 20 41 70 | 70 6c 65 45 76 65 6e 74 |sage, Ap|pleEvent|
|00003bc0| 26 20 72 65 70 6c 79 2c | 20 6c 6f 6e 67 20 72 65 |& reply,| long re|
|00003bd0| 66 43 6f 6e 29 0d 7b 0d | 09 73 77 69 74 63 68 20 |fCon).{.|.switch |
|00003be0| 28 72 65 66 43 6f 6e 29 | 0d 09 7b 0d 09 63 61 73 |(refCon)|..{..cas|
|00003bf0| 65 20 63 46 69 6e 64 65 | 72 4e 65 77 3a 0d 09 09 |e cFinde|rNew:...|
|00003c00| 74 68 69 73 2d 3e 44 6f | 46 69 6e 64 65 72 4e 65 |this->Do|FinderNe|
|00003c10| 77 28 6d 65 73 73 61 67 | 65 2c 20 72 65 70 6c 79 |w(messag|e, reply|
|00003c20| 29 3b 0d 09 09 62 72 65 | 61 6b 3b 0d 09 63 61 73 |);...bre|ak;..cas|
|00003c30| 65 20 63 46 69 6e 64 65 | 72 4f 70 65 6e 3a 0d 09 |e cFinde|rOpen:..|
|00003c40| 09 74 68 69 73 2d 3e 44 | 6f 46 69 6e 64 65 72 4f |.this->D|oFinderO|
|00003c50| 70 65 6e 28 6d 65 73 73 | 61 67 65 2c 20 72 65 70 |pen(mess|age, rep|
|00003c60| 6c 79 29 3b 0d 09 09 62 | 72 65 61 6b 3b 0d 09 63 |ly);...b|reak;..c|
|00003c70| 61 73 65 20 63 46 69 6e | 64 65 72 50 72 69 6e 74 |ase cFin|derPrint|
|00003c80| 3a 0d 09 09 74 68 69 73 | 2d 3e 44 6f 46 69 6e 64 |:...this|->DoFind|
|00003c90| 65 72 50 72 69 6e 74 28 | 6d 65 73 73 61 67 65 2c |erPrint(|message,|
|00003ca0| 20 72 65 70 6c 79 29 3b | 0d 09 09 62 72 65 61 6b | reply);|...break|
|00003cb0| 3b 0d 09 63 61 73 65 20 | 63 46 69 6e 64 65 72 51 |;..case |cFinderQ|
|00003cc0| 75 69 74 3a 0d 09 09 74 | 68 69 73 2d 3e 44 6f 46 |uit:...t|his->DoF|
|00003cd0| 69 6e 64 65 72 51 75 69 | 74 28 6d 65 73 73 61 67 |inderQui|t(messag|
|00003ce0| 65 2c 20 72 65 70 6c 79 | 29 3b 0d 09 09 62 72 65 |e, reply|);...bre|
|00003cf0| 61 6b 3b 0d 09 63 61 73 | 65 20 63 4e 65 77 45 6c |ak;..cas|e cNewEl|
|00003d00| 65 6d 65 6e 74 3a 0d 09 | 09 74 68 69 73 2d 3e 44 |ement:..|.this->D|
|00003d10| 6f 41 70 70 6c 65 4e 65 | 77 45 6c 65 6d 65 6e 74 |oAppleNe|wElement|
|00003d20| 28 6d 65 73 73 61 67 65 | 2c 20 72 65 70 6c 79 29 |(message|, reply)|
|00003d30| 3b 0d 09 09 62 72 65 61 | 6b 3b 0d 09 64 65 66 61 |;...brea|k;..defa|
|00003d40| 75 6c 74 3a 0d 09 09 4d | 41 70 70 6c 65 4f 62 6a |ult:...M|AppleObj|
|00003d50| 65 63 74 3a 3a 44 6f 41 | 70 70 6c 65 45 76 65 6e |ect::DoA|ppleEven|
|00003d60| 74 28 6d 65 73 73 61 67 | 65 2c 20 72 65 70 6c 79 |t(messag|e, reply|
|00003d70| 2c 20 72 65 66 43 6f 6e | 29 3b 0d 09 09 62 72 65 |, refCon|);...bre|
|00003d80| 61 6b 3b 0d 09 7d 0d 7d | 0d 0d 0d 4d 41 70 70 6c |ak;..}.}|...MAppl|
|00003d90| 65 4f 62 6a 65 63 74 2a | 20 54 45 53 61 6d 70 6c |eObject*| TESampl|
|00003da0| 65 3a 3a 47 65 74 43 6f | 6e 74 61 69 6e 65 64 4f |e::GetCo|ntainedO|
|00003db0| 62 6a 65 63 74 28 44 65 | 73 63 54 79 70 65 20 64 |bject(De|scType d|
|00003dc0| 65 73 69 72 65 64 54 79 | 70 65 2c 20 44 65 73 63 |esiredTy|pe, Desc|
|00003dd0| 54 79 70 65 20 6b 65 79 | 46 6f 72 6d 2c 0d 09 09 |Type key|Form,...|
|00003de0| 09 09 09 09 09 09 09 09 | 20 20 20 63 6f 6e 73 74 |........| const|
|00003df0| 20 41 45 44 65 73 63 26 | 20 6b 65 79 44 61 74 61 | AEDesc&| keyData|
|00003e00| 2c 20 42 6f 6f 6c 65 61 | 6e 26 20 6e 65 65 64 44 |, Boolea|n& needD|
|00003e10| 69 73 70 6f 73 61 6c 29 | 0d 7b 0d 09 4d 41 70 70 |isposal)|.{..MApp|
|00003e20| 6c 65 4f 62 6a 65 63 74 | 2a 09 72 65 73 75 6c 74 |leObject|*.result|
|00003e30| 20 3d 20 6e 69 6c 3b 0d | 0d 09 73 77 69 74 63 68 | = nil;.|..switch|
|00003e40| 20 28 64 65 73 69 72 65 | 64 54 79 70 65 29 0d 09 | (desire|dType)..|
|00003e50| 7b 0d 09 63 61 73 65 20 | 63 57 69 6e 64 6f 77 3a |{..case |cWindow:|
|00003e60| 0d 09 09 72 65 73 75 6c | 74 20 3d 20 74 68 69 73 |...resul|t = this|
|00003e70| 2d 3e 47 65 74 57 69 6e | 64 6f 77 4f 62 6a 65 63 |->GetWin|dowObjec|
|00003e80| 74 28 6b 65 79 46 6f 72 | 6d 2c 20 6b 65 79 44 61 |t(keyFor|m, keyDa|
|00003e90| 74 61 29 3b 0d 09 09 6e | 65 65 64 44 69 73 70 6f |ta);...n|eedDispo|
|00003ea0| 73 61 6c 20 3d 20 66 61 | 6c 73 65 3b 0d 09 09 62 |sal = fa|lse;...b|
|00003eb0| 72 65 61 6b 3b 0d 09 7d | 0d 0d 09 2f 2f 20 69 66 |reak;..}|...// if|
|00003ec0| 20 77 65 20 63 61 6e d5 | 74 20 66 69 6e 64 20 69 | we can.|t find i|
|00003ed0| 74 2c 20 6c 65 74 20 74 | 68 65 20 70 61 72 65 6e |t, let t|he paren|
|00003ee0| 74 20 66 69 6e 64 20 69 | 74 0d 09 69 66 20 28 72 |t find i|t..if (r|
|00003ef0| 65 73 75 6c 74 20 3d 3d | 20 6e 69 6c 29 0d 09 09 |esult ==| nil)...|
|00003f00| 72 65 73 75 6c 74 20 3d | 20 4d 41 70 70 6c 65 4f |result =| MAppleO|
|00003f10| 62 6a 65 63 74 3a 3a 47 | 65 74 43 6f 6e 74 61 69 |bject::G|etContai|
|00003f20| 6e 65 64 4f 62 6a 65 63 | 74 28 64 65 73 69 72 65 |nedObjec|t(desire|
|00003f30| 64 54 79 70 65 2c 20 6b | 65 79 46 6f 72 6d 2c 20 |dType, k|eyForm, |
|00003f40| 6b 65 79 44 61 74 61 2c | 20 6e 65 65 64 44 69 73 |keyData,| needDis|
|00003f50| 70 6f 73 61 6c 29 3b 0d | 0d 09 72 65 74 75 72 6e |posal);.|..return|
|00003f60| 20 72 65 73 75 6c 74 3b | 0d 7d 0d 0d 0d 42 6f 6f | result;|.}...Boo|
|00003f70| 6c 65 61 6e 20 54 45 53 | 61 6d 70 6c 65 3a 3a 43 |lean TES|ample::C|
|00003f80| 6f 6d 70 61 72 65 41 70 | 70 6c 65 4f 62 6a 65 63 |ompareAp|pleObjec|
|00003f90| 74 73 28 44 65 73 63 54 | 79 70 65 20 6f 70 65 72 |ts(DescT|ype oper|
|00003fa0| 61 74 69 6f 6e 2c 20 63 | 6f 6e 73 74 20 4d 41 70 |ation, c|onst MAp|
|00003fb0| 70 6c 65 4f 62 6a 65 63 | 74 26 20 74 6f 57 68 61 |pleObjec|t& toWha|
|00003fc0| 74 29 0d 7b 0d 09 72 65 | 74 75 72 6e 20 4d 41 70 |t).{..re|turn MAp|
|00003fd0| 70 6c 65 4f 62 6a 65 63 | 74 3a 3a 43 6f 6d 70 61 |pleObjec|t::Compa|
|00003fe0| 72 65 41 70 70 6c 65 4f | 62 6a 65 63 74 73 28 6f |reAppleO|bjects(o|
|00003ff0| 70 65 72 61 74 69 6f 6e | 2c 20 74 6f 57 68 61 74 |peration|, toWhat|
|00004000| 29 3b 0d 7d 0d 0d 0d 76 | 6f 69 64 20 54 45 53 61 |);.}...v|oid TESa|
|00004010| 6d 70 6c 65 3a 3a 44 6f | 46 69 6e 64 65 72 4e 65 |mple::Do|FinderNe|
|00004020| 77 28 63 6f 6e 73 74 20 | 41 70 70 6c 65 45 76 65 |w(const |AppleEve|
|00004030| 6e 74 26 20 6d 65 73 73 | 61 67 65 2c 20 41 70 70 |nt& mess|age, App|
|00004040| 6c 65 45 76 65 6e 74 26 | 20 2f 2a 20 72 65 70 6c |leEvent&| /* repl|
|00004050| 79 20 2a 2f 29 0d 7b 0d | 09 4d 41 70 70 6c 65 4f |y */).{.|.MAppleO|
|00004060| 62 6a 65 63 74 3a 3a 47 | 6f 74 52 65 71 75 69 72 |bject::G|otRequir|
|00004070| 65 64 50 61 72 61 6d 65 | 74 65 72 73 28 6d 65 73 |edParame|ters(mes|
|00004080| 73 61 67 65 29 3b 0d 09 | 74 68 69 73 2d 3e 44 6f |sage);..|this->Do|
|00004090| 4e 65 77 28 29 3b 0d 7d | 0d 0d 0d 76 6f 69 64 20 |New();.}|...void |
|000040a0| 54 45 53 61 6d 70 6c 65 | 3a 3a 44 6f 46 69 6e 64 |TESample|::DoFind|
|000040b0| 65 72 4f 70 65 6e 28 63 | 6f 6e 73 74 20 41 70 70 |erOpen(c|onst App|
|000040c0| 6c 65 45 76 65 6e 74 26 | 20 6d 65 73 73 61 67 65 |leEvent&| message|
|000040d0| 2c 20 41 70 70 6c 65 45 | 76 65 6e 74 26 20 2f 2a |, AppleE|vent& /*|
|000040e0| 20 72 65 70 6c 79 20 2a | 2f 29 0d 7b 0d 09 41 45 | reply *|/).{..AE|
|000040f0| 44 65 73 63 4c 69 73 74 | 09 6c 69 73 74 4f 66 46 |DescList|.listOfF|
|00004100| 69 6c 65 73 3b 0d 09 4f | 53 45 72 72 09 09 74 68 |iles;..O|SErr..th|
|00004110| 65 45 72 72 3b 0d 0d 09 | 46 61 69 6c 4f 53 45 72 |eErr;...|FailOSEr|
|00004120| 72 28 41 45 47 65 74 50 | 61 72 61 6d 44 65 73 63 |r(AEGetP|aramDesc|
|00004130| 28 26 6d 65 73 73 61 67 | 65 2c 20 6b 65 79 44 69 |(&messag|e, keyDi|
|00004140| 72 65 63 74 4f 62 6a 65 | 63 74 2c 20 74 79 70 65 |rectObje|ct, type|
|00004150| 41 45 4c 69 73 74 2c 20 | 26 6c 69 73 74 4f 66 46 |AEList, |&listOfF|
|00004160| 69 6c 65 73 29 29 3b 0d | 09 54 52 59 0d 09 7b 0d |iles));.|.TRY..{.|
|00004170| 09 09 6c 6f 6e 67 09 6e | 75 6d 46 69 6c 65 73 3b |..long.n|umFiles;|
|00004180| 0d 09 09 46 61 69 6c 4f | 53 45 72 72 28 41 45 43 |...FailO|SErr(AEC|
|00004190| 6f 75 6e 74 49 74 65 6d | 73 28 26 6c 69 73 74 4f |ountItem|s(&listO|
|000041a0| 66 46 69 6c 65 73 2c 20 | 26 6e 75 6d 46 69 6c 65 |fFiles, |&numFile|
|000041b0| 73 29 29 3b 0d 0d 09 09 | 66 6f 72 20 28 6c 6f 6e |s));....|for (lon|
|000041c0| 67 20 69 20 3d 20 31 3b | 20 69 20 3c 3d 20 6e 75 |g i = 1;| i <= nu|
|000041d0| 6d 46 69 6c 65 73 3b 20 | 69 2b 2b 29 0d 09 09 7b |mFiles; |i++)...{|
|000041e0| 0d 09 09 09 54 52 59 0d | 09 09 09 7b 0d 09 09 09 |....TRY.|...{....|
|000041f0| 09 44 65 73 63 54 79 70 | 65 09 61 63 74 75 61 6c |.DescTyp|e.actual|
|00004200| 54 79 70 65 3b 0d 09 09 | 09 09 46 53 53 70 65 63 |Type;...|..FSSpec|
|00004210| 20 09 09 74 68 65 46 69 | 6c 65 53 70 65 63 3b 0d | ..theFi|leSpec;.|
|00004220| 09 09 09 09 41 45 4b 65 | 79 77 6f 72 64 20 09 74 |....AEKe|yword .t|
|00004230| 68 65 41 63 74 75 61 6c | 4b 65 79 3b 0d 09 09 09 |heActual|Key;....|
|00004240| 09 53 69 7a 65 09 09 61 | 63 74 75 61 6c 53 69 7a |.Size..a|ctualSiz|
|00004250| 65 3b 0d 09 09 09 09 46 | 49 6e 66 6f 09 09 66 69 |e;.....F|Info..fi|
|00004260| 6e 64 65 72 49 6e 66 6f | 3b 0d 0d 09 09 09 09 46 |nderInfo|;......F|
|00004270| 61 69 6c 4f 53 45 72 72 | 28 41 45 47 65 74 4e 74 |ailOSErr|(AEGetNt|
|00004280| 68 50 74 72 28 26 6c 69 | 73 74 4f 66 46 69 6c 65 |hPtr(&li|stOfFile|
|00004290| 73 2c 20 69 2c 20 74 79 | 70 65 46 53 53 2c 20 26 |s, i, ty|peFSS, &|
|000042a0| 74 68 65 41 63 74 75 61 | 6c 4b 65 79 2c 0d 09 09 |theActua|lKey,...|
|000042b0| 09 09 09 09 09 09 09 20 | 20 26 61 63 74 75 61 6c |....... | &actual|
|000042c0| 54 79 70 65 2c 20 28 50 | 74 72 29 20 26 74 68 65 |Type, (P|tr) &the|
|000042d0| 46 69 6c 65 53 70 65 63 | 2c 0d 09 09 09 09 09 09 |FileSpec|,.......|
|000042e0| 09 09 09 20 20 73 69 7a | 65 6f 66 28 74 68 65 46 |... siz|eof(theF|
|000042f0| 69 6c 65 53 70 65 63 29 | 2c 20 26 61 63 74 75 61 |ileSpec)|, &actua|
|00004300| 6c 53 69 7a 65 29 29 3b | 0d 09 09 09 09 46 61 69 |lSize));|.....Fai|
|00004310| 6c 4f 53 45 72 72 28 46 | 53 70 47 65 74 46 49 6e |lOSErr(F|SpGetFIn|
|00004320| 66 6f 28 26 74 68 65 46 | 69 6c 65 53 70 65 63 2c |fo(&theF|ileSpec,|
|00004330| 20 26 66 69 6e 64 65 72 | 49 6e 66 6f 29 29 3b 0d | &finder|Info));.|
|00004340| 0d 09 09 09 09 4d 41 70 | 70 6c 65 4f 62 6a 65 63 |.....MAp|pleObjec|
|00004350| 74 3a 3a 47 6f 74 52 65 | 71 75 69 72 65 64 50 61 |t::GotRe|quiredPa|
|00004360| 72 61 6d 65 74 65 72 73 | 28 6d 65 73 73 61 67 65 |rameters|(message|
|00004370| 29 3b 0d 09 09 09 09 74 | 68 69 73 2d 3e 4f 70 65 |);.....t|his->Ope|
|00004380| 6e 41 44 6f 63 28 74 68 | 65 46 69 6c 65 53 70 65 |nADoc(th|eFileSpe|
|00004390| 63 2e 76 52 65 66 4e 75 | 6d 2c 20 74 68 65 46 69 |c.vRefNu|m, theFi|
|000043a0| 6c 65 53 70 65 63 2e 70 | 61 72 49 44 2c 20 74 68 |leSpec.p|arID, th|
|000043b0| 65 46 69 6c 65 53 70 65 | 63 2e 6e 61 6d 65 2c 0d |eFileSpe|c.name,.|
|000043c0| 09 09 09 09 09 09 09 20 | 20 20 66 69 6e 64 65 72 |....... | finder|
|000043d0| 49 6e 66 6f 2e 66 64 54 | 79 70 65 29 3b 0d 09 09 |Info.fdT|ype);...|
|000043e0| 09 7d 0d 09 09 09 52 45 | 43 4f 56 45 52 0d 09 09 |.}....RE|COVER...|
|000043f0| 09 7b 0d 09 09 09 09 67 | 6f 74 6f 20 70 72 6f 63 |.{.....g|oto proc|
|00004400| 65 73 73 4e 65 78 74 46 | 69 6c 65 3b 0d 09 09 09 |essNextF|ile;....|
|00004410| 7d 0d 09 09 09 45 4e 44 | 54 52 59 0d 0d 70 72 6f |}....END|TRY..pro|
|00004420| 63 65 73 73 4e 65 78 74 | 46 69 6c 65 3a 0d 09 09 |cessNext|File:...|
|00004430| 09 3b 0d 09 09 7d 0d 09 | 7d 0d 09 52 45 43 4f 56 |.;...}..|}..RECOV|
|00004440| 45 52 0d 09 7b 0d 09 09 | 74 68 65 45 72 72 20 3d |ER..{...|theErr =|
|00004450| 20 41 45 44 69 73 70 6f | 73 65 44 65 73 63 28 26 | AEDispo|seDesc(&|
|00004460| 6c 69 73 74 4f 66 46 69 | 6c 65 73 29 3b 0d 09 7d |listOfFi|les);..}|
|00004470| 0d 09 45 4e 44 54 52 59 | 0d 0d 09 74 68 65 45 72 |..ENDTRY|...theEr|
|00004480| 72 20 3d 20 41 45 44 69 | 73 70 6f 73 65 44 65 73 |r = AEDi|sposeDes|
|00004490| 63 28 26 6c 69 73 74 4f | 66 46 69 6c 65 73 29 3b |c(&listO|fFiles);|
|000044a0| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 54 45 53 61 6d 70 |.}...voi|d TESamp|
|000044b0| 6c 65 3a 3a 44 6f 46 69 | 6e 64 65 72 50 72 69 6e |le::DoFi|nderPrin|
|000044c0| 74 28 63 6f 6e 73 74 20 | 41 70 70 6c 65 45 76 65 |t(const |AppleEve|
|000044d0| 6e 74 26 20 2f 2a 20 6d | 65 73 73 61 67 65 20 2a |nt& /* m|essage *|
|000044e0| 2f 2c 20 41 70 70 6c 65 | 45 76 65 6e 74 26 20 2f |/, Apple|Event& /|
|000044f0| 2a 20 72 65 70 6c 79 20 | 2a 2f 29 0d 7b 0d 09 2f |* reply |*/).{../|
|00004500| 2f 20 77 65 20 64 6f 6e | d5 74 20 70 72 69 6e 74 |/ we don|.t print|
|00004510| 20 66 72 6f 6d 20 74 68 | 65 20 66 69 6e 64 65 72 | from th|e finder|
|00004520| 2c 20 79 65 74 0d 7d 0d | 0d 0d 76 6f 69 64 20 54 |, yet.}.|..void T|
|00004530| 45 53 61 6d 70 6c 65 3a | 3a 44 6f 46 69 6e 64 65 |ESample:|:DoFinde|
|00004540| 72 51 75 69 74 28 63 6f | 6e 73 74 20 41 70 70 6c |rQuit(co|nst Appl|
|00004550| 65 45 76 65 6e 74 26 20 | 6d 65 73 73 61 67 65 2c |eEvent& |message,|
|00004560| 20 41 70 70 6c 65 45 76 | 65 6e 74 26 20 2f 2a 20 | AppleEv|ent& /* |
|00004570| 72 65 70 6c 79 20 2a 2f | 29 0d 7b 0d 09 4d 41 70 |reply */|).{..MAp|
|00004580| 70 6c 65 4f 62 6a 65 63 | 74 3a 3a 47 6f 74 52 65 |pleObjec|t::GotRe|
|00004590| 71 75 69 72 65 64 50 61 | 72 61 6d 65 74 65 72 73 |quiredPa|rameters|
|000045a0| 28 6d 65 73 73 61 67 65 | 29 3b 0d 09 66 44 6f 6e |(message|);..fDon|
|000045b0| 65 20 3d 20 74 72 75 65 | 3b 0d 7d 0d 0d 0d 4d 41 |e = true|;.}...MA|
|000045c0| 70 70 6c 65 4f 62 6a 65 | 63 74 2a 20 54 45 53 61 |ppleObje|ct* TESa|
|000045d0| 6d 70 6c 65 3a 3a 47 65 | 74 57 69 6e 64 6f 77 4f |mple::Ge|tWindowO|
|000045e0| 62 6a 65 63 74 28 44 65 | 73 63 54 79 70 65 20 66 |bject(De|scType f|
|000045f0| 6f 72 6d 2c 20 63 6f 6e | 73 74 20 41 45 44 65 73 |orm, con|st AEDes|
|00004600| 63 26 20 73 65 6c 65 63 | 74 69 6f 6e 44 61 74 61 |c& selec|tionData|
|00004610| 29 0d 7b 0d 09 57 69 6e | 64 6f 77 50 74 72 09 74 |).{..Win|dowPtr.t|
|00004620| 68 65 57 69 6e 64 6f 77 | 20 3d 20 6e 69 6c 3b 0d |heWindow| = nil;.|
|00004630| 0d 09 4f 53 45 72 72 09 | 69 67 6e 6f 72 65 45 72 |..OSErr.|ignoreEr|
|00004640| 72 3b 0d 0d 09 73 77 69 | 74 63 68 20 28 66 6f 72 |r;...swi|tch (for|
|00004650| 6d 29 0d 09 7b 0d 09 63 | 61 73 65 20 66 6f 72 6d |m)..{..c|ase form|
|00004660| 4e 61 6d 65 3a 0d 09 09 | 7b 0d 09 09 41 45 44 65 |Name:...|{...AEDe|
|00004670| 73 63 09 74 68 65 4e 61 | 6d 65 44 65 73 63 3b 0d |sc.theNa|meDesc;.|
|00004680| 09 09 53 74 72 32 35 35 | 09 74 68 65 4e 61 6d 65 |..Str255|.theName|
|00004690| 3b 0d 09 09 53 69 7a 65 | 09 73 74 72 69 6e 67 53 |;...Size|.stringS|
|000046a0| 69 7a 65 3b 0d 09 09 46 | 61 69 6c 4f 53 45 72 72 |ize;...F|ailOSErr|
|000046b0| 28 41 45 43 6f 65 72 63 | 65 44 65 73 63 28 26 73 |(AECoerc|eDesc(&s|
|000046c0| 65 6c 65 63 74 69 6f 6e | 44 61 74 61 2c 20 63 54 |election|Data, cT|
|000046d0| 65 78 74 2c 20 26 74 68 | 65 4e 61 6d 65 44 65 73 |ext, &th|eNameDes|
|000046e0| 63 29 29 3b 0d 09 09 73 | 74 72 69 6e 67 53 69 7a |c));...s|tringSiz|
|000046f0| 65 20 3d 20 47 65 74 48 | 61 6e 64 6c 65 53 69 7a |e = GetH|andleSiz|
|00004700| 65 28 74 68 65 4e 61 6d | 65 44 65 73 63 2e 64 61 |e(theNam|eDesc.da|
|00004710| 74 61 48 61 6e 64 6c 65 | 29 3b 0d 09 09 69 66 20 |taHandle|);...if |
|00004720| 28 73 74 72 69 6e 67 53 | 69 7a 65 20 3c 20 32 35 |(stringS|ize < 25|
|00004730| 36 29 0d 09 09 7b 0d 09 | 09 09 74 68 65 4e 61 6d |6)...{..|..theNam|
|00004740| 65 5b 30 5d 20 3d 20 28 | 63 68 61 72 29 20 73 74 |e[0] = (|char) st|
|00004750| 72 69 6e 67 53 69 7a 65 | 3b 0d 09 09 09 42 6c 6f |ringSize|;....Blo|
|00004760| 63 6b 4d 6f 76 65 28 2a | 74 68 65 4e 61 6d 65 44 |ckMove(*|theNameD|
|00004770| 65 73 63 2e 64 61 74 61 | 48 61 6e 64 6c 65 2c 20 |esc.data|Handle, |
|00004780| 26 74 68 65 4e 61 6d 65 | 5b 31 5d 2c 20 73 74 72 |&theName|[1], str|
|00004790| 69 6e 67 53 69 7a 65 29 | 3b 0d 09 09 09 74 68 65 |ingSize)|;....the|
|000047a0| 57 69 6e 64 6f 77 20 3d | 20 47 65 74 57 69 6e 64 |Window =| GetWind|
|000047b0| 6f 77 46 72 6f 6d 4e 61 | 6d 65 28 74 68 65 4e 61 |owFromNa|me(theNa|
|000047c0| 6d 65 29 3b 0d 09 09 7d | 0d 09 09 69 67 6e 6f 72 |me);...}|...ignor|
|000047d0| 65 45 72 72 20 3d 20 41 | 45 44 69 73 70 6f 73 65 |eErr = A|EDispose|
|000047e0| 44 65 73 63 28 26 74 68 | 65 4e 61 6d 65 44 65 73 |Desc(&th|eNameDes|
|000047f0| 63 29 3b 0d 09 09 7d 0d | 09 09 62 72 65 61 6b 3b |c);...}.|..break;|
|00004800| 0d 09 63 61 73 65 20 66 | 6f 72 6d 41 62 73 6f 6c |..case f|ormAbsol|
|00004810| 75 74 65 50 6f 73 69 74 | 69 6f 6e 3a 0d 09 09 7b |utePosit|ion:...{|
|00004820| 0d 09 09 41 45 44 65 73 | 63 09 69 6e 64 65 78 44 |...AEDes|c.indexD|
|00004830| 65 73 63 3b 0d 09 09 73 | 68 6f 72 74 09 69 6e 64 |esc;...s|hort.ind|
|00004840| 65 78 3b 0d 09 09 46 61 | 69 6c 4f 53 45 72 72 28 |ex;...Fa|ilOSErr(|
|00004850| 41 45 43 6f 65 72 63 65 | 44 65 73 63 28 26 73 65 |AECoerce|Desc(&se|
|00004860| 6c 65 63 74 69 6f 6e 44 | 61 74 61 2c 20 74 79 70 |lectionD|ata, typ|
|00004870| 65 53 68 6f 72 74 49 6e | 74 65 67 65 72 2c 20 26 |eShortIn|teger, &|
|00004880| 69 6e 64 65 78 44 65 73 | 63 29 29 3b 0d 09 09 69 |indexDes|c));...i|
|00004890| 6e 64 65 78 20 3d 20 2a | 28 73 68 6f 72 74 2a 29 |ndex = *|(short*)|
|000048a0| 2a 69 6e 64 65 78 44 65 | 73 63 2e 64 61 74 61 48 |*indexDe|sc.dataH|
|000048b0| 61 6e 64 6c 65 3b 0d 09 | 09 69 67 6e 6f 72 65 45 |andle;..|.ignoreE|
|000048c0| 72 72 20 3d 20 41 45 44 | 69 73 70 6f 73 65 44 65 |rr = AED|isposeDe|
|000048d0| 73 63 28 26 69 6e 64 65 | 78 44 65 73 63 29 3b 0d |sc(&inde|xDesc);.|
|000048e0| 0d 09 09 74 68 65 57 69 | 6e 64 6f 77 20 3d 20 47 |...theWi|ndow = G|
|000048f0| 65 74 57 69 6e 64 6f 77 | 46 72 6f 6d 49 6e 64 65 |etWindow|FromInde|
|00004900| 78 28 69 6e 64 65 78 29 | 3b 0d 09 09 7d 0d 09 09 |x(index)|;...}...|
|00004910| 62 72 65 61 6b 3b 0d 09 | 64 65 66 61 75 6c 74 3a |break;..|default:|
|00004920| 0d 09 09 46 61 69 6c 4f | 53 45 72 72 28 65 72 72 |...FailO|SErr(err|
|00004930| 41 45 57 72 6f 6e 67 44 | 61 74 61 54 79 70 65 29 |AEWrongD|ataType)|
|00004940| 3b 0d 09 7d 0d 0d 09 72 | 65 74 75 72 6e 20 28 54 |;..}...r|eturn (T|
|00004950| 45 44 6f 63 75 6d 65 6e | 74 2a 29 20 44 6f 63 4c |EDocumen|t*) DocL|
|00004960| 69 73 74 28 29 2d 3e 46 | 69 6e 64 44 6f 63 28 74 |ist()->F|indDoc(t|
|00004970| 68 65 57 69 6e 64 6f 77 | 29 3b 0d 7d 0d 0d 0d 76 |heWindow|);.}...v|
|00004980| 6f 69 64 20 54 45 53 61 | 6d 70 6c 65 3a 3a 44 6f |oid TESa|mple::Do|
|00004990| 41 70 70 6c 65 4e 65 77 | 45 6c 65 6d 65 6e 74 28 |AppleNew|Element(|
|000049a0| 63 6f 6e 73 74 20 41 70 | 70 6c 65 45 76 65 6e 74 |const Ap|pleEvent|
|000049b0| 26 20 6d 65 73 73 61 67 | 65 2c 20 41 70 70 6c 65 |& messag|e, Apple|
|000049c0| 45 76 65 6e 74 26 20 2f | 2a 20 72 65 70 6c 79 20 |Event& /|* reply |
|000049d0| 2a 2f 29 0d 7b 0d 09 44 | 65 73 63 54 79 70 65 09 |*/).{..D|escType.|
|000049e0| 72 65 74 75 72 6e 65 64 | 54 79 70 65 3b 0d 09 44 |returned|Type;..D|
|000049f0| 65 73 63 54 79 70 65 09 | 63 6c 61 73 73 4f 66 4e |escType.|classOfN|
|00004a00| 65 77 45 6c 65 6d 65 6e | 74 3b 0d 09 53 69 7a 65 |ewElemen|t;..Size|
|00004a10| 09 09 61 63 74 75 61 6c | 53 69 7a 65 3b 0d 09 46 |..actual|Size;..F|
|00004a20| 61 69 6c 4f 53 45 72 72 | 28 41 45 47 65 74 50 61 |ailOSErr|(AEGetPa|
|00004a30| 72 61 6d 50 74 72 28 26 | 6d 65 73 73 61 67 65 2c |ramPtr(&|message,|
|00004a40| 20 6b 65 79 41 45 4f 62 | 6a 54 6f 43 72 65 61 74 | keyAEOb|jToCreat|
|00004a50| 65 2c 20 74 79 70 65 54 | 79 70 65 2c 20 26 72 65 |e, typeT|ype, &re|
|00004a60| 74 75 72 6e 65 64 54 79 | 70 65 2c 0d 09 09 09 09 |turnedTy|pe,.....|
|00004a70| 09 09 09 28 50 74 72 29 | 20 26 63 6c 61 73 73 4f |...(Ptr)| &classO|
|00004a80| 66 4e 65 77 45 6c 65 6d | 65 6e 74 2c 20 73 69 7a |fNewElem|ent, siz|
|00004a90| 65 6f 66 28 63 6c 61 73 | 73 4f 66 4e 65 77 45 6c |eof(clas|sOfNewEl|
|00004aa0| 65 6d 65 6e 74 29 2c 0d | 09 09 09 09 09 09 09 26 |ement),.|.......&|
|00004ab0| 61 63 74 75 61 6c 53 69 | 7a 65 29 29 3b 0d 0d 09 |actualSi|ze));...|
|00004ac0| 2f 2f 20 77 65 20 6f 6e | 6c 79 20 63 72 65 61 74 |// we on|ly creat|
|00004ad0| 65 20 6e 65 77 20 77 69 | 6e 64 6f 77 73 0d 09 69 |e new wi|ndows..i|
|00004ae0| 66 20 28 63 6c 61 73 73 | 4f 66 4e 65 77 45 6c 65 |f (class|OfNewEle|
|00004af0| 6d 65 6e 74 20 21 3d 20 | 63 57 69 6e 64 6f 77 29 |ment != |cWindow)|
|00004b00| 0d 09 09 46 61 69 6c 4f | 53 45 72 72 28 65 72 72 |...FailO|SErr(err|
|00004b10| 41 45 57 72 6f 6e 67 44 | 61 74 61 54 79 70 65 29 |AEWrongD|ataType)|
|00004b20| 3b 0d 0d 09 4d 41 70 70 | 6c 65 4f 62 6a 65 63 74 |;...MApp|leObject|
|00004b30| 3a 3a 47 6f 74 52 65 71 | 75 69 72 65 64 50 61 72 |::GotReq|uiredPar|
|00004b40| 61 6d 65 74 65 72 73 28 | 6d 65 73 73 61 67 65 29 |ameters(|message)|
|00004b50| 3b 0d 0d 09 2f 2f 20 63 | 72 65 61 74 65 20 74 68 |;...// c|reate th|
|00004b60| 65 20 6e 65 77 20 77 69 | 6e 64 6f 77 0d 09 74 68 |e new wi|ndow..th|
|00004b70| 69 73 2d 3e 44 6f 4e 65 | 77 28 29 3b 0d 7d 0d 0d |is->DoNe|w();.}..|
|00004b80| 0d 57 69 6e 64 6f 77 50 | 74 72 20 47 65 74 57 69 |.WindowP|tr GetWi|
|00004b90| 6e 64 6f 77 46 72 6f 6d | 4e 61 6d 65 28 53 74 72 |ndowFrom|Name(Str|
|00004ba0| 32 35 35 20 6e 61 6d 65 | 29 0d 7b 0d 09 57 69 6e |255 name|).{..Win|
|00004bb0| 64 6f 77 50 74 72 09 72 | 65 73 75 6c 74 20 3d 20 |dowPtr.r|esult = |
|00004bc0| 46 72 6f 6e 74 57 69 6e | 64 6f 77 28 29 3b 0d 09 |FrontWin|dow();..|
|00004bd0| 53 74 72 32 35 35 09 09 | 77 69 6e 64 6f 77 54 69 |Str255..|windowTi|
|00004be0| 74 6c 65 3b 0d 0d 09 66 | 6f 72 20 28 3b 72 65 73 |tle;...f|or (;res|
|00004bf0| 75 6c 74 20 21 3d 20 6e | 69 6c 3b 29 0d 09 7b 0d |ult != n|il;)..{.|
|00004c00| 09 09 47 65 74 57 54 69 | 74 6c 65 28 72 65 73 75 |..GetWTi|tle(resu|
|00004c10| 6c 74 2c 20 77 69 6e 64 | 6f 77 54 69 74 6c 65 29 |lt, wind|owTitle)|
|00004c20| 3b 0d 09 09 69 66 20 28 | 45 71 75 61 6c 53 74 72 |;...if (|EqualStr|
|00004c30| 69 6e 67 28 77 69 6e 64 | 6f 77 54 69 74 6c 65 2c |ing(wind|owTitle,|
|00004c40| 20 6e 61 6d 65 2c 20 66 | 61 6c 73 65 2c 20 74 72 | name, f|alse, tr|
|00004c50| 75 65 29 29 0d 09 09 09 | 62 72 65 61 6b 3b 0d 0d |ue))....|break;..|
|00004c60| 09 09 72 65 73 75 6c 74 | 20 3d 20 28 57 69 6e 64 |..result| = (Wind|
|00004c70| 6f 77 50 74 72 29 20 28 | 28 57 69 6e 64 6f 77 50 |owPtr) (|(WindowP|
|00004c80| 65 65 6b 29 72 65 73 75 | 6c 74 29 2d 3e 6e 65 78 |eek)resu|lt)->nex|
|00004c90| 74 57 69 6e 64 6f 77 3b | 0d 09 7d 0d 0d 09 72 65 |tWindow;|..}...re|
|00004ca0| 74 75 72 6e 20 72 65 73 | 75 6c 74 3b 0d 7d 0d 0d |turn res|ult;.}..|
|00004cb0| 0d 57 69 6e 64 6f 77 50 | 74 72 20 47 65 74 57 69 |.WindowP|tr GetWi|
|00004cc0| 6e 64 6f 77 46 72 6f 6d | 49 6e 64 65 78 28 73 68 |ndowFrom|Index(sh|
|00004cd0| 6f 72 74 20 69 6e 64 65 | 78 29 0d 7b 0d 09 57 69 |ort inde|x).{..Wi|
|00004ce0| 6e 64 6f 77 50 74 72 09 | 72 65 73 75 6c 74 20 3d |ndowPtr.|result =|
|00004cf0| 20 46 72 6f 6e 74 57 69 | 6e 64 6f 77 28 29 3b 0d | FrontWi|ndow();.|
|00004d00| 0d 09 66 6f 72 20 28 73 | 68 6f 72 74 20 69 20 3d |..for (s|hort i =|
|00004d10| 20 31 3b 20 69 20 3c 20 | 69 6e 64 65 78 20 20 26 | 1; i < |index &|
|00004d20| 26 20 20 72 65 73 75 6c | 74 20 21 3d 20 6e 69 6c |& resul|t != nil|
|00004d30| 3b 20 69 2b 2b 29 0d 09 | 09 72 65 73 75 6c 74 20 |; i++)..|.result |
|00004d40| 3d 20 28 57 69 6e 64 6f | 77 50 74 72 29 20 28 28 |= (Windo|wPtr) ((|
|00004d50| 57 69 6e 64 6f 77 50 65 | 65 6b 29 72 65 73 75 6c |WindowPe|ek)resul|
|00004d60| 74 29 2d 3e 6e 65 78 74 | 57 69 6e 64 6f 77 3b 0d |t)->next|Window;.|
|00004d70| 0d 09 72 65 74 75 72 6e | 20 72 65 73 75 6c 74 3b |..return| result;|
|00004d80| 0d 7d 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.}......|........|
|00004d90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004da0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004db0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004dc0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004dd0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004de0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004df0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e00| 00 00 01 00 00 00 02 9e | 00 00 01 9e 00 00 00 4a |........|.......J|
|00004e10| 43 6f 70 79 43 6c 65 61 | 72 20 3d 20 54 52 55 45 |CopyClea|r = TRUE|
|00004e20| 3b 0d 09 09 70 61 73 74 | 65 20 3d 20 54 52 55 45 |;...past|e = TRUE|
|00004e30| 0b 54 45 53 61 6d 70 6c | 65 2e 63 70 02 00 00 00 |.TESampl|e.cp....|
|00004e40| 54 45 58 54 4d 50 53 20 | 01 00 00 d0 00 80 00 00 |TEXTMPS |........|
|00004e50| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 d0 00 80 |..TEXTMP|S ......|
|00004e60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004e70| 00 00 a0 45 60 50 00 00 | 4d 02 00 00 02 e8 29 5b |...E`P..|M.....)[|
|00004e80| 30 5d 5b 30 5d 20 29 0d | 09 09 09 69 66 20 28 20 |0][0] ).|...if ( |
|00004e90| 73 65 6c 53 74 61 72 74 | 20 3c 20 73 65 6c 45 6e |selStart| < selEn|
|00004ea0| 64 20 29 0d 09 09 09 09 | 63 75 74 43 6f 70 79 43 |d ).....|cutCopyC|
|00004eb0| 6c 65 61 72 20 3d 20 54 | 52 55 45 3b 0d 09 09 09 |lear = T|RUE;....|
|00004ec0| 09 2f 2a 43 75 74 2c 20 | 43 6f 70 79 2c 20 61 6e |./*Cut, |Copy, an|
|00004ed0| 64 20 43 6c 65 61 72 20 | 69 73 20 65 6e 61 62 6c |d Clear |is enabl|
|00004ee0| 65 64 20 66 6f 72 20 61 | 70 70 2e 20 77 69 6e 64 |ed for a|pp. wind|
|00004ef0| 6f 77 73 20 77 69 74 68 | 20 73 65 6c 65 63 74 69 |ows with| selecti|
|00004f00| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 01 d1 |...H..Mo|naco....|
|00004f10| 00 00 00 14 00 01 21 a8 | 00 0a 00 00 00 00 00 00 |......!.|........|
|00004f20| 00 00 01 d8 00 00 00 06 | 00 04 00 45 00 2d 01 cc |........|...E.-..|
|00004f30| 02 45 00 45 00 2d 01 cc | 02 45 a6 59 82 38 00 00 |.E.E.-..|.E.Y.8..|
|00004f40| 0f 3e 00 00 0f 5a 00 00 | 00 00 01 00 00 00 01 2c |.>...Z..|.......,|
|00004f50| 00 0b 00 00 09 47 00 00 | 09 52 05 6d 61 69 6e 00 |.....G..|.R.main.|
|00004f60| 00 00 0c b8 00 00 0c ca | 13 54 45 53 61 6d 70 6c |........|.TESampl|
|00004f70| 65 3a 3a 54 45 53 61 6d | 70 6c 65 00 00 00 0f 97 |e::TESam|ple.....|
|00004f80| 00 00 0f ab 15 54 45 53 | 61 6d 70 6c 65 3a 3a 48 |.....TES|ample::H|
|00004f90| 65 61 70 4e 65 65 64 65 | 64 00 00 00 10 52 00 00 |eapNeede|d....R..|
|00004fa0| 10 64 13 54 45 53 61 6d | 70 6c 65 3a 3a 53 6c 65 |.d.TESam|ple::Sle|
|00004fb0| 65 70 56 61 6c 00 00 00 | 11 f7 00 00 12 07 11 54 |epVal...|.......T|
|00004fc0| 45 53 61 6d 70 6c 65 3a | 3a 44 6f 49 64 6c 65 00 |ESample:|:DoIdle.|
|00004fd0| 00 00 13 05 00 00 13 1b | 17 54 45 53 61 6d 70 6c |........|.TESampl|
|00004fe0| 65 3a 3a 41 64 6a 75 73 | 74 43 75 72 73 6f 72 00 |e::Adjus|tCursor.|
|00004ff0| 00 00 19 9b 00 00 19 b0 | 15 54 45 53 61 6d 70 6c |........|.TESampl|
|00005000| 65 3a 3a 41 64 6a 75 73 | 74 4d 65 6e 75 73 00 00 |e::Adjus|tMenus..|
|00005010| 28 99 00 00 28 b0 17 54 | 45 53 61 6d 70 6c 65 3a |(...(..T|ESample:|
|00005020| 3a 44 6f 4d 65 6e 75 43 | 6f 6d 6d 61 6e 64 00 00 |:DoMenuC|ommand..|
|00005030| 35 55 00 00 35 64 0f 54 | 45 53 61 6d 70 6c 65 3a |5U..5d.T|ESample:|
|00005040| 3a 44 6f 4e 65 77 00 00 | 36 2c 00 00 36 3e 13 54 |:DoNew..|6,..6>.T|
|00005050| 45 53 61 6d 70 6c 65 3a | 3a 4f 70 65 6e 41 44 6f |ESample:|:OpenADo|
|00005060| 63 00 00 00 37 f4 00 00 | 38 04 11 54 45 53 61 6d |c...7...|8..TESam|
|00005070| 70 6c 65 3a 3a 44 6f 4f | 70 65 6e 00 00 00 00 1e |ple::DoO|pen.....|
|00005080| 00 45 00 2d 01 cc 02 45 | 00 45 00 2d 01 cc 02 45 |.E.-...E|.E.-...E|
|00005090| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000050a0| 01 00 00 00 02 9e 00 00 | 01 9e 00 00 00 4a 00 3f |........|.....J.?|
|000050b0| 56 b8 0a 4a 00 00 00 1c | 00 4a 00 00 4d 50 53 52 |V..J....|.J..MPSR|
|000050c0| 00 02 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|000050d0| 03 ef ff ff 00 00 00 4c | 00 00 00 00 03 f0 ff ff |.......L|........|
|000050e0| 00 00 01 7c 00 45 56 08 | 00 00 00 00 00 00 00 00 |...|.EV.|........|
|000050f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+